From 1ccc37a104fd84645dd5cf041576191233c91f6b Mon Sep 17 00:00:00 2001 From: asteam Date: Fri, 26 Sep 2025 19:17:30 +0300 Subject: [PATCH] v11.0.0 --- README.md | 158 ++++--- check.go | 88 ++++ client.go | 10 +- client_bvs.go | 8 +- config/config.go | 2 +- config/config_bvs.go | 4 +- config/legacy-config.go | 2 +- go.mod | 2 +- internal/constants/constants.go | 4 + internal/validators/custom.go | 32 +- internal/validators/helper.go | 2 +- internal/validators/messages.go | 25 ++ internal/validators/validator.go | 20 + internal/validators/values.go | 12 +- legacy-client.go | 8 +- pkg/cloudapi/account.go | 2 +- pkg/cloudapi/account/account.go | 2 +- pkg/cloudapi/account/add_user.go | 2 +- pkg/cloudapi/account/audits.go | 2 +- pkg/cloudapi/account/create.go | 75 ---- pkg/cloudapi/account/delete.go | 2 +- pkg/cloudapi/account/delete_user.go | 2 +- pkg/cloudapi/account/disable_enable.go | 6 +- pkg/cloudapi/account/get.go | 2 +- .../account/get_consumed_account_units.go | 2 +- .../get_consumed_cloud_units_by_type.go | 2 +- .../account/get_reserved_account_units.go | 2 +- .../account/get_resource_consumption.go | 2 +- pkg/cloudapi/account/list.go | 2 +- pkg/cloudapi/account/list_computes.go | 2 +- pkg/cloudapi/account/list_deleted.go | 2 +- pkg/cloudapi/account/list_disks.go | 2 +- pkg/cloudapi/account/list_flipgroups.go | 2 +- pkg/cloudapi/account/list_rg.go | 2 +- pkg/cloudapi/account/list_templates.go | 2 +- pkg/cloudapi/account/list_vins.go | 2 +- pkg/cloudapi/account/models.go | 9 + pkg/cloudapi/account/restore.go | 2 +- pkg/cloudapi/account/serialize.go | 2 +- pkg/cloudapi/account/update.go | 6 +- pkg/cloudapi/account/update_user.go | 2 +- pkg/cloudapi/audit.go | 2 +- pkg/cloudapi/audit/audit.go | 2 +- pkg/cloudapi/audit/get.go | 4 +- pkg/cloudapi/bservice.go | 2 +- pkg/cloudapi/bservice/bservice.go | 2 +- pkg/cloudapi/bservice/create.go | 2 +- pkg/cloudapi/bservice/delete.go | 2 +- pkg/cloudapi/bservice/disable.go | 2 +- pkg/cloudapi/bservice/enable.go | 2 +- pkg/cloudapi/bservice/get.go | 2 +- pkg/cloudapi/bservice/group_add.go | 6 +- pkg/cloudapi/bservice/group_compute_remove.go | 2 +- pkg/cloudapi/bservice/group_get.go | 2 +- pkg/cloudapi/bservice/group_parent_add.go | 2 +- pkg/cloudapi/bservice/group_parent_remove.go | 2 +- pkg/cloudapi/bservice/group_remove.go | 2 +- pkg/cloudapi/bservice/group_resize.go | 8 +- pkg/cloudapi/bservice/group_start.go | 2 +- pkg/cloudapi/bservice/group_stop.go | 2 +- pkg/cloudapi/bservice/group_update.go | 2 +- pkg/cloudapi/bservice/group_update_extnet.go | 2 +- pkg/cloudapi/bservice/group_update_vins.go | 2 +- pkg/cloudapi/bservice/list.go | 2 +- pkg/cloudapi/bservice/list_deleted.go | 2 +- pkg/cloudapi/bservice/models.go | 3 + pkg/cloudapi/bservice/restore.go | 2 +- pkg/cloudapi/bservice/serialize.go | 2 +- pkg/cloudapi/bservice/snapshot_create.go | 2 +- pkg/cloudapi/bservice/snapshot_delete.go | 2 +- pkg/cloudapi/bservice/snapshot_list.go | 2 +- pkg/cloudapi/bservice/snapshot_rollback.go | 2 +- pkg/cloudapi/bservice/start.go | 2 +- pkg/cloudapi/bservice/stop.go | 2 +- pkg/cloudapi/cloudapi.go | 2 +- pkg/cloudapi/compute.go | 2 +- .../compute/affinity_group_check_start.go | 2 +- pkg/cloudapi/compute/affinity_label_remove.go | 2 +- pkg/cloudapi/compute/affinity_label_set.go | 2 +- pkg/cloudapi/compute/affinity_relations.go | 2 +- pkg/cloudapi/compute/affinity_rule_add.go | 2 +- pkg/cloudapi/compute/affinity_rule_remove.go | 2 +- pkg/cloudapi/compute/affinity_rules_clear.go | 2 +- .../compute/anti_affinity_rule_add.go | 2 +- .../compute/anti_affinity_rule_remove.go | 2 +- .../compute/anti_affinity_rules_clear.go | 2 +- pkg/cloudapi/compute/attach_gpu.go | 2 +- pkg/cloudapi/compute/attach_pci_device.go | 2 +- pkg/cloudapi/compute/audits.go | 2 +- pkg/cloudapi/compute/boot_disk_set.go | 2 +- pkg/cloudapi/compute/boot_order_get.go | 2 +- pkg/cloudapi/compute/boot_order_set.go | 2 +- pkg/cloudapi/compute/cd_eject.go | 2 +- pkg/cloudapi/compute/cd_insert.go | 2 +- pkg/cloudapi/compute/change_ip.go | 10 +- pkg/cloudapi/compute/change_link_state.go | 2 +- pkg/cloudapi/compute/change_mac.go | 46 ++ pkg/cloudapi/compute/clone.go | 2 +- pkg/cloudapi/compute/compute.go | 2 +- pkg/cloudapi/compute/create_template.go | 2 +- .../compute/create_template_from_blank.go | 6 +- pkg/cloudapi/compute/delete.go | 2 +- pkg/cloudapi/compute/delete_custom_fields.go | 2 +- pkg/cloudapi/compute/detach_gpu.go | 2 +- pkg/cloudapi/compute/detach_pci_device.go | 2 +- pkg/cloudapi/compute/disable.go | 2 +- pkg/cloudapi/compute/disk_add.go | 2 +- pkg/cloudapi/compute/disk_attach.go | 2 +- pkg/cloudapi/compute/disk_del.go | 2 +- pkg/cloudapi/compute/disk_detach.go | 2 +- pkg/cloudapi/compute/disk_migrate.go | 2 +- pkg/cloudapi/compute/disk_qos.go | 2 +- pkg/cloudapi/compute/disk_resize.go | 2 +- .../compute/disk_switch_to_replication.go | 2 +- pkg/cloudapi/compute/enable.go | 2 +- pkg/cloudapi/compute/filter.go | 6 +- pkg/cloudapi/compute/filter_test.go | 10 +- pkg/cloudapi/compute/get.go | 2 +- pkg/cloudapi/compute/get_audits.go | 2 +- pkg/cloudapi/compute/get_console_url.go | 2 +- pkg/cloudapi/compute/get_custom_fields.go | 2 +- pkg/cloudapi/compute/get_log.go | 2 +- pkg/cloudapi/compute/list.go | 2 +- pkg/cloudapi/compute/list_deleted.go | 2 +- pkg/cloudapi/compute/list_pci_device.go | 2 +- pkg/cloudapi/compute/list_vgpu.go | 2 +- pkg/cloudapi/compute/models.go | 111 ++++- pkg/cloudapi/compute/move_to_rg.go | 2 +- pkg/cloudapi/compute/net_attach.go | 6 +- pkg/cloudapi/compute/net_detach.go | 2 +- pkg/cloudapi/compute/pause.go | 2 +- pkg/cloudapi/compute/pfw_add.go | 2 +- pkg/cloudapi/compute/pfw_del.go | 2 +- pkg/cloudapi/compute/pfw_list.go | 2 +- pkg/cloudapi/compute/pin_to_stack.go | 2 +- pkg/cloudapi/compute/power_cycle.go | 2 +- pkg/cloudapi/compute/reboot.go | 2 +- pkg/cloudapi/compute/redeploy.go | 2 +- pkg/cloudapi/compute/reset.go | 2 +- pkg/cloudapi/compute/resize.go | 2 +- pkg/cloudapi/compute/restore.go | 2 +- pkg/cloudapi/compute/resume.go | 2 +- pkg/cloudapi/compute/serialize.go | 2 +- pkg/cloudapi/compute/set_custom_fields.go | 2 +- pkg/cloudapi/compute/snapshot_create.go | 2 +- pkg/cloudapi/compute/snapshot_delete.go | 2 +- pkg/cloudapi/compute/snapshot_list.go | 2 +- pkg/cloudapi/compute/snapshot_rollback.go | 2 +- pkg/cloudapi/compute/snapshot_usage.go | 2 +- pkg/cloudapi/compute/start.go | 2 +- pkg/cloudapi/compute/stop.go | 2 +- pkg/cloudapi/compute/tag_add.go | 2 +- pkg/cloudapi/compute/tag_remove.go | 2 +- pkg/cloudapi/compute/unpin_from_stack.go | 2 +- pkg/cloudapi/compute/update.go | 33 +- pkg/cloudapi/compute/user_grant.go | 2 +- pkg/cloudapi/compute/user_list.go | 2 +- pkg/cloudapi/compute/user_revoke.go | 2 +- pkg/cloudapi/compute/user_update.go | 2 +- pkg/cloudapi/disks.go | 2 +- pkg/cloudapi/disks/create.go | 17 +- pkg/cloudapi/disks/delete.go | 2 +- pkg/cloudapi/disks/delete_disks.go | 2 +- pkg/cloudapi/disks/disks.go | 2 +- pkg/cloudapi/disks/filter.go | 6 +- pkg/cloudapi/disks/filter_test.go | 38 +- pkg/cloudapi/disks/from_platform_disk.go | 6 +- pkg/cloudapi/disks/get.go | 2 +- pkg/cloudapi/disks/limitio.go | 2 +- pkg/cloudapi/disks/list.go | 2 +- pkg/cloudapi/disks/list_deleted.go | 2 +- pkg/cloudapi/disks/list_types.go | 2 +- pkg/cloudapi/disks/list_unattached.go | 2 +- pkg/cloudapi/disks/models.go | 48 ++- pkg/cloudapi/disks/rename.go | 2 +- pkg/cloudapi/disks/replicate.go | 2 +- pkg/cloudapi/disks/replication_resume.go | 2 +- pkg/cloudapi/disks/replication_reverse.go | 2 +- pkg/cloudapi/disks/replication_start.go | 2 +- pkg/cloudapi/disks/replication_status.go | 2 +- pkg/cloudapi/disks/replication_stop.go | 2 +- pkg/cloudapi/disks/replication_suspend.go | 2 +- pkg/cloudapi/disks/resize.go | 2 +- pkg/cloudapi/disks/restore.go | 2 +- pkg/cloudapi/disks/serialize.go | 2 +- pkg/cloudapi/disks/share.go | 2 +- pkg/cloudapi/disks/snapshot_delete.go | 2 +- pkg/cloudapi/disks/snapshot_rollback.go | 2 +- pkg/cloudapi/disks/unshare.go | 2 +- pkg/cloudapi/dpdknet.go | 2 +- pkg/cloudapi/dpdknet/dpdknet.go | 2 +- pkg/cloudapi/dpdknet/get.go | 2 +- pkg/cloudapi/dpdknet/list.go | 2 +- pkg/cloudapi/extnet.go | 2 +- pkg/cloudapi/extnet/extnet.go | 2 +- pkg/cloudapi/extnet/get.go | 2 +- pkg/cloudapi/extnet/get_reserved_ip.go | 2 +- pkg/cloudapi/extnet/list.go | 6 +- pkg/cloudapi/extnet/list_computes.go | 2 +- pkg/cloudapi/extnet/models.go | 3 + pkg/cloudapi/extnet/serialize.go | 2 +- pkg/cloudapi/flipgroup.go | 2 +- pkg/cloudapi/flipgroup/compute_add.go | 2 +- pkg/cloudapi/flipgroup/compute_remove.go | 2 +- pkg/cloudapi/flipgroup/create.go | 2 +- pkg/cloudapi/flipgroup/delete.go | 2 +- pkg/cloudapi/flipgroup/edit.go | 2 +- pkg/cloudapi/flipgroup/flipgroup.go | 2 +- pkg/cloudapi/flipgroup/get.go | 2 +- pkg/cloudapi/flipgroup/list.go | 2 +- pkg/cloudapi/flipgroup/serialize.go | 2 +- pkg/cloudapi/image.go | 2 +- pkg/cloudapi/image/create.go | 2 +- pkg/cloudapi/image/create_virtual.go | 2 +- pkg/cloudapi/image/delete.go | 2 +- pkg/cloudapi/image/get.go | 2 +- pkg/cloudapi/image/image.go | 2 +- pkg/cloudapi/image/link.go | 2 +- pkg/cloudapi/image/list.go | 2 +- pkg/cloudapi/image/models.go | 5 +- pkg/cloudapi/image/rename.go | 2 +- pkg/cloudapi/image/serialize.go | 2 +- pkg/cloudapi/k8ci.go | 2 +- pkg/cloudapi/k8ci/get.go | 2 +- pkg/cloudapi/k8ci/k8ci.go | 2 +- pkg/cloudapi/k8ci/list.go | 2 +- pkg/cloudapi/k8ci/list_deleted.go | 2 +- pkg/cloudapi/k8ci/serialize.go | 2 +- pkg/cloudapi/k8s.go | 2 +- pkg/cloudapi/k8s/create.go | 2 +- pkg/cloudapi/k8s/delete.go | 2 +- pkg/cloudapi/k8s/delete_master_from_group.go | 2 +- pkg/cloudapi/k8s/delete_worker_from_group.go | 2 +- pkg/cloudapi/k8s/disable_enable.go | 2 +- pkg/cloudapi/k8s/find_group_by_label.go | 2 +- pkg/cloudapi/k8s/get.go | 2 +- pkg/cloudapi/k8s/get_config.go | 2 +- pkg/cloudapi/k8s/get_node_annotations.go | 2 +- pkg/cloudapi/k8s/get_node_labels.go | 2 +- pkg/cloudapi/k8s/get_node_taints.go | 2 +- .../k8s/get_worker_nodes_meta_data.go | 2 +- pkg/cloudapi/k8s/k8s.go | 2 +- pkg/cloudapi/k8s/list.go | 2 +- pkg/cloudapi/k8s/list_deleted.go | 2 +- pkg/cloudapi/k8s/models.go | 3 + pkg/cloudapi/k8s/restore.go | 2 +- pkg/cloudapi/k8s/serialize.go | 2 +- pkg/cloudapi/k8s/start.go | 2 +- pkg/cloudapi/k8s/stop.go | 2 +- pkg/cloudapi/k8s/update.go | 2 +- .../k8s/update_worker_nodes_meta_data.go | 2 +- pkg/cloudapi/k8s/worker_add.go | 2 +- pkg/cloudapi/k8s/worker_reset.go | 2 +- pkg/cloudapi/k8s/worker_restart.go | 2 +- pkg/cloudapi/k8s/workers_group_add.go | 2 +- pkg/cloudapi/k8s/workers_group_delete.go | 2 +- pkg/cloudapi/k8s/workers_group_get_by_name.go | 2 +- pkg/cloudapi/kvmx86.go | 2 +- pkg/cloudapi/kvmx86/create.go | 6 +- pkg/cloudapi/kvmx86/create_blank.go | 18 +- pkg/cloudapi/kvmx86/kvmx86.go | 2 +- pkg/cloudapi/lb.go | 2 +- pkg/cloudapi/lb/backend_create.go | 2 +- pkg/cloudapi/lb/backend_delete.go | 2 +- pkg/cloudapi/lb/backend_server_add.go | 2 +- pkg/cloudapi/lb/backend_server_delete.go | 2 +- pkg/cloudapi/lb/backend_server_update.go | 2 +- pkg/cloudapi/lb/backend_update.go | 2 +- pkg/cloudapi/lb/config_reset.go | 2 +- pkg/cloudapi/lb/create.go | 2 +- pkg/cloudapi/lb/delete.go | 2 +- pkg/cloudapi/lb/disable_enable.go | 2 +- pkg/cloudapi/lb/filter.go | 4 +- pkg/cloudapi/lb/frontend_bind.go | 2 +- pkg/cloudapi/lb/frontend_bind_delete.go | 2 +- pkg/cloudapi/lb/frontend_bind_update.go | 2 +- pkg/cloudapi/lb/frontend_create.go | 2 +- pkg/cloudapi/lb/frontend_delete.go | 2 +- pkg/cloudapi/lb/get.go | 2 +- pkg/cloudapi/lb/lb.go | 2 +- pkg/cloudapi/lb/list.go | 2 +- pkg/cloudapi/lb/list_deleted.go | 2 +- pkg/cloudapi/lb/make_highly_available.go | 2 +- pkg/cloudapi/lb/restart.go | 2 +- pkg/cloudapi/lb/restore.go | 2 +- pkg/cloudapi/lb/serialize.go | 2 +- pkg/cloudapi/lb/start.go | 2 +- pkg/cloudapi/lb/stop.go | 2 +- pkg/cloudapi/lb/update.go | 2 +- pkg/cloudapi/lb/update_sysctl_params.go | 2 +- pkg/cloudapi/locations/list.go | 2 +- pkg/cloudapi/locations/locations.go | 2 +- pkg/cloudapi/locations/models.go | 3 + pkg/cloudapi/locations/serialize.go | 2 +- pkg/cloudapi/locatons.go | 2 +- pkg/cloudapi/pcidevice.go | 2 +- pkg/cloudapi/pcidevice/list.go | 2 +- pkg/cloudapi/pcidevice/pcidevice.go | 2 +- pkg/cloudapi/pcidevice/serialize.go | 2 +- pkg/cloudapi/prometheus.go | 8 + pkg/cloudapi/prometheus/compute_cpu_load.go | 57 +++ .../prometheus/compute_memory_available.go | 53 +++ .../prometheus/compute_memory_unused.go | 53 +++ .../prometheus/compute_memory_usable.go | 53 +++ .../prometheus/compute_memory_usage.go | 53 +++ .../prometheus/compute_memory_used.go | 53 +++ pkg/cloudapi/prometheus/compute_read_bytes.go | 57 +++ .../prometheus/compute_read_requests.go | 57 +++ .../prometheus/compute_receive_bytes.go | 57 +++ .../prometheus/compute_receive_packets.go | 57 +++ .../prometheus/compute_transmit_bytes.go | 57 +++ .../prometheus/compute_transmit_packets.go | 57 +++ .../prometheus/compute_write_bytes.go | 57 +++ .../prometheus/compute_write_requests.go | 57 +++ pkg/cloudapi/prometheus/computes.go | 77 ++++ pkg/cloudapi/prometheus/models.go | 40 ++ pkg/cloudapi/prometheus/prometheus.go | 15 + pkg/cloudapi/rg.go | 2 +- pkg/cloudapi/rg/access_grant.go | 2 +- pkg/cloudapi/rg/access_revoke.go | 2 +- pkg/cloudapi/rg/affinity_group_computes.go | 2 +- pkg/cloudapi/rg/affinity_groups_get.go | 2 +- pkg/cloudapi/rg/affinity_groups_list.go | 2 +- pkg/cloudapi/rg/audits.go | 2 +- pkg/cloudapi/rg/create.go | 6 +- pkg/cloudapi/rg/delete.go | 2 +- pkg/cloudapi/rg/disable.go | 2 +- pkg/cloudapi/rg/enable.go | 2 +- pkg/cloudapi/rg/filter_test.go | 81 ++-- pkg/cloudapi/rg/get.go | 2 +- pkg/cloudapi/rg/get_resource_consumption.go | 2 +- pkg/cloudapi/rg/list.go | 2 +- pkg/cloudapi/rg/list_computes.go | 2 +- pkg/cloudapi/rg/list_deleted.go | 2 +- pkg/cloudapi/rg/list_lb.go | 2 +- pkg/cloudapi/rg/list_pfw.go | 2 +- pkg/cloudapi/rg/list_vins.go | 2 +- pkg/cloudapi/rg/models.go | 6 - pkg/cloudapi/rg/remove_def_net.go | 2 +- pkg/cloudapi/rg/restore.go | 2 +- pkg/cloudapi/rg/rg.go | 2 +- pkg/cloudapi/rg/serialize.go | 2 +- pkg/cloudapi/rg/set_def_net.go | 2 +- pkg/cloudapi/rg/update.go | 6 +- pkg/cloudapi/rg/usage.go | 2 +- pkg/cloudapi/sep.go | 8 + pkg/cloudapi/sep/filter.go | 83 ++++ pkg/cloudapi/sep/filter_test.go | 134 ++++++ pkg/cloudapi/sep/ids.go | 10 + .../sep/list_available_sep_and_pools.go | 52 +++ pkg/cloudapi/sep/models.go | 34 ++ pkg/cloudapi/sep/sep.go | 18 + pkg/cloudapi/sep/serialize.go | 43 ++ pkg/cloudapi/stack.go | 2 +- pkg/cloudapi/stack/get.go | 2 +- pkg/cloudapi/stack/list.go | 2 +- pkg/cloudapi/stack/stack.go | 2 +- pkg/cloudapi/tasks.go | 2 +- pkg/cloudapi/tasks/get.go | 2 +- pkg/cloudapi/tasks/list.go | 2 +- pkg/cloudapi/tasks/tasks.go | 2 +- pkg/cloudapi/user.go | 2 +- pkg/cloudapi/user/api_list.go | 2 +- pkg/cloudapi/user/authenticate.go | 2 +- pkg/cloudapi/user/get.go | 2 +- pkg/cloudapi/user/get_audit.go | 4 + .../user/is_valid_invite_user_token.go | 2 +- pkg/cloudapi/user/set_data.go | 2 +- pkg/cloudapi/user/user.go | 2 +- pkg/cloudapi/vfpool.go | 2 +- pkg/cloudapi/vfpool/get.go | 2 +- pkg/cloudapi/vfpool/list.go | 2 +- pkg/cloudapi/vfpool/serialize.go | 2 +- pkg/cloudapi/vfpool/vfpool.go | 2 +- pkg/cloudapi/vins.go | 2 +- pkg/cloudapi/vins/audits.go | 2 +- pkg/cloudapi/vins/create_in_account.go | 2 +- pkg/cloudapi/vins/create_in_rg.go | 2 +- pkg/cloudapi/vins/delete.go | 2 +- pkg/cloudapi/vins/disable_enable.go | 2 +- pkg/cloudapi/vins/dns_apply.go | 2 +- pkg/cloudapi/vins/extnet_connect.go | 2 +- pkg/cloudapi/vins/extnet_disconnect.go | 2 +- pkg/cloudapi/vins/extnet_list.go | 2 +- pkg/cloudapi/vins/get.go | 2 +- pkg/cloudapi/vins/ip_list.go | 2 +- pkg/cloudapi/vins/ip_release.go | 2 +- pkg/cloudapi/vins/ip_reserve.go | 2 +- pkg/cloudapi/vins/list.go | 6 +- pkg/cloudapi/vins/list_deleted.go | 2 +- pkg/cloudapi/vins/nat_rule_add.go | 2 +- pkg/cloudapi/vins/nat_rule_del.go | 2 +- pkg/cloudapi/vins/nat_rule_list.go | 2 +- pkg/cloudapi/vins/restore.go | 2 +- pkg/cloudapi/vins/serialize.go | 2 +- .../vins/static_route_access_grant.go | 2 +- .../vins/static_route_access_revoke.go | 2 +- pkg/cloudapi/vins/static_route_add.go | 2 +- pkg/cloudapi/vins/static_route_del.go | 2 +- pkg/cloudapi/vins/static_route_list.go | 2 +- pkg/cloudapi/vins/vins.go | 2 +- pkg/cloudapi/vins/vnfdev_redeploy.go | 2 +- pkg/cloudapi/vins/vnfdev_restart.go | 2 +- pkg/cloudbroker/account.go | 2 +- pkg/cloudbroker/account/account.go | 2 +- pkg/cloudbroker/account/add_user.go | 2 +- pkg/cloudbroker/account/audits.go | 2 +- pkg/cloudbroker/account/create.go | 8 +- pkg/cloudbroker/account/delete.go | 10 +- pkg/cloudbroker/account/delete_accounts.go | 2 +- pkg/cloudbroker/account/delete_user.go | 2 +- pkg/cloudbroker/account/disable.go | 6 +- pkg/cloudbroker/account/disable_accounts.go | 6 +- pkg/cloudbroker/account/enable.go | 2 +- pkg/cloudbroker/account/enable_accounts.go | 2 +- pkg/cloudbroker/account/get.go | 2 +- .../account/get_resource_consumption.go | 2 +- .../account/grant_access_templates.go | 2 +- pkg/cloudbroker/account/list.go | 2 +- .../account/list_available_templates.go | 2 +- pkg/cloudbroker/account/list_computes.go | 2 +- pkg/cloudbroker/account/list_deleted.go | 2 +- pkg/cloudbroker/account/list_disks.go | 2 +- pkg/cloudbroker/account/list_flip_groups.go | 2 +- pkg/cloudbroker/account/list_rg.go | 2 +- pkg/cloudbroker/account/list_vins.go | 2 +- pkg/cloudbroker/account/models.go | 6 + pkg/cloudbroker/account/restore.go | 6 +- .../account/revoke_access_templates.go | 2 +- pkg/cloudbroker/account/serialize.go | 2 +- .../account/set_cpu_allocation_parameter.go | 2 +- .../account/set_cpu_allocation_ratio.go | 2 +- pkg/cloudbroker/account/update.go | 6 +- .../account/update_compute_features.go | 4 +- .../account/update_resource_types.go | 2 +- pkg/cloudbroker/account/update_user.go | 2 +- pkg/cloudbroker/apiaccess.go | 2 +- pkg/cloudbroker/apiaccess/api_find.go | 18 +- pkg/cloudbroker/apiaccess/apiaccess.go | 2 +- pkg/cloudbroker/apiaccess/apis_exclude.go | 4 +- pkg/cloudbroker/apiaccess/apis_include.go | 4 +- pkg/cloudbroker/apiaccess/copy.go | 4 +- pkg/cloudbroker/apiaccess/create.go | 2 +- pkg/cloudbroker/apiaccess/delete.go | 4 +- pkg/cloudbroker/apiaccess/desc_update.go | 4 +- pkg/cloudbroker/apiaccess/get.go | 4 +- .../{get_pre_groups.go => get_default.go} | 10 +- pkg/cloudbroker/apiaccess/list.go | 12 +- pkg/cloudbroker/apiaccess/list_deleted.go | 48 --- pkg/cloudbroker/apiaccess/models.go | 61 ++- pkg/cloudbroker/apiaccess/set_default.go | 4 +- pkg/cloudbroker/apiaccess/subtract.go | 6 +- pkg/cloudbroker/apiaccess/union.go | 6 +- pkg/cloudbroker/apiaccess/update.go | 4 +- pkg/cloudbroker/apiaccess/user_list.go | 4 +- pkg/cloudbroker/audit.go | 2 +- pkg/cloudbroker/audit/audit.go | 2 +- pkg/cloudbroker/audit/get.go | 4 +- pkg/cloudbroker/audit/linked_jobs.go | 4 +- pkg/cloudbroker/audit/list.go | 16 +- pkg/cloudbroker/audit/models.go | 27 ++ pkg/cloudbroker/backup.go | 2 +- pkg/cloudbroker/backup/backup.go | 2 +- pkg/cloudbroker/backup/create_disk_backup.go | 2 +- pkg/cloudbroker/backup/create_disks_backup.go | 2 +- pkg/cloudbroker/backup/delete_disk_backup.go | 2 +- pkg/cloudbroker/backup/list_backup_paths.go | 2 +- .../backup/restore_disk_from_backup.go | 2 +- .../backup/restore_disks_from_backup.go | 2 +- pkg/cloudbroker/bservice.go | 8 + pkg/cloudbroker/bservice/bservice.go | 15 + pkg/cloudbroker/bservice/create.go | 50 +++ pkg/cloudbroker/bservice/delete.go | 42 ++ pkg/cloudbroker/bservice/disable.go | 40 ++ pkg/cloudbroker/bservice/enable.go | 41 ++ pkg/cloudbroker/bservice/filter.go | 71 ++++ pkg/cloudbroker/bservice/filter_test.go | 155 +++++++ pkg/cloudbroker/bservice/get.go | 46 ++ pkg/cloudbroker/bservice/group_add.go | 112 +++++ .../bservice/group_compute_remove.go | 46 ++ pkg/cloudbroker/bservice/group_get.go | 44 ++ .../bservice/group_parent_remove.go | 48 +++ pkg/cloudbroker/bservice/group_parrent_add.go | 46 ++ pkg/cloudbroker/bservice/group_remove.go | 43 ++ pkg/cloudbroker/bservice/group_resize.go | 59 +++ pkg/cloudbroker/bservice/group_start.go | 42 ++ pkg/cloudbroker/bservice/group_stop.go | 46 ++ pkg/cloudbroker/bservice/group_update.go | 76 ++++ .../bservice/group_update_extnet.go | 46 ++ pkg/cloudbroker/bservice/group_update_vins.go | 46 ++ pkg/cloudbroker/bservice/list.go | 87 ++++ pkg/cloudbroker/bservice/list_deleted.go | 56 +++ pkg/cloudbroker/bservice/models.go | 401 ++++++++++++++++++ pkg/cloudbroker/bservice/restore.go | 38 ++ pkg/cloudbroker/bservice/snapshot_create.go | 42 ++ pkg/cloudbroker/bservice/snapshot_delete.go | 42 ++ pkg/cloudbroker/bservice/snapshot_list.go | 40 ++ pkg/cloudbroker/bservice/snapshot_rollback.go | 42 ++ pkg/cloudbroker/bservice/sorting.go | 60 +++ pkg/cloudbroker/bservice/start.go | 40 ++ pkg/cloudbroker/bservice/stop.go | 40 ++ pkg/cloudbroker/cloudbroker.go | 2 +- pkg/cloudbroker/compute.go | 2 +- .../compute/affinity_group_check_start.go | 2 +- .../compute/affinity_label_remove.go | 2 +- pkg/cloudbroker/compute/affinity_label_set.go | 2 +- pkg/cloudbroker/compute/affinity_relations.go | 2 +- pkg/cloudbroker/compute/affinity_rule_add.go | 2 +- .../compute/affinity_rule_remove.go | 2 +- .../compute/affinity_rules_clear.go | 2 +- .../compute/anti_affinity_rule_add.go | 2 +- .../compute/anti_affinity_rule_clear.go | 2 +- .../compute/anti_affinity_rule_remove.go | 2 +- pkg/cloudbroker/compute/attach_gpu.go | 2 +- pkg/cloudbroker/compute/attach_pci_device.go | 2 +- pkg/cloudbroker/compute/audits.go | 2 +- pkg/cloudbroker/compute/boot_disk_set.go | 2 +- pkg/cloudbroker/compute/boot_order_get.go | 2 +- pkg/cloudbroker/compute/boot_order_set.go | 2 +- pkg/cloudbroker/compute/cd_eject.go | 2 +- pkg/cloudbroker/compute/cd_insert.go | 2 +- pkg/cloudbroker/compute/change_ip.go | 10 +- pkg/cloudbroker/compute/change_link_state.go | 2 +- pkg/cloudbroker/compute/change_mac.go | 46 ++ pkg/cloudbroker/compute/clone.go | 2 +- pkg/cloudbroker/compute/compute.go | 2 +- pkg/cloudbroker/compute/computeci_set.go | 2 +- pkg/cloudbroker/compute/computeci_unset.go | 2 +- pkg/cloudbroker/compute/create_template.go | 2 +- .../compute/create_template_from_blank.go | 6 +- pkg/cloudbroker/compute/delete.go | 2 +- .../compute/delete_custom_fields.go | 2 +- pkg/cloudbroker/compute/detach_gpu.go | 2 +- pkg/cloudbroker/compute/detach_pci_device.go | 2 +- pkg/cloudbroker/compute/disable.go | 2 +- pkg/cloudbroker/compute/disk_add.go | 2 +- pkg/cloudbroker/compute/disk_attach.go | 2 +- pkg/cloudbroker/compute/disk_del.go | 2 +- pkg/cloudbroker/compute/disk_detach.go | 2 +- pkg/cloudbroker/compute/disk_migrate.go | 2 +- pkg/cloudbroker/compute/disk_qos.go | 2 +- pkg/cloudbroker/compute/disk_resize.go | 2 +- .../compute/disk_switch_to_replication.go | 2 +- pkg/cloudbroker/compute/enable.go | 2 +- pkg/cloudbroker/compute/filter.go | 167 +++++++- pkg/cloudbroker/compute/filter_test.go | 251 ++++++++++- pkg/cloudbroker/compute/get.go | 2 +- pkg/cloudbroker/compute/get_audits.go | 2 +- pkg/cloudbroker/compute/get_console_url.go | 2 +- pkg/cloudbroker/compute/get_custom_fields.go | 2 +- pkg/cloudbroker/compute/get_log.go | 2 +- pkg/cloudbroker/compute/list.go | 6 +- pkg/cloudbroker/compute/list_deleted.go | 6 +- pkg/cloudbroker/compute/list_pci_device.go | 2 +- pkg/cloudbroker/compute/list_vgpu.go | 2 +- pkg/cloudbroker/compute/mass_delete.go | 2 +- pkg/cloudbroker/compute/mass_reboot.go | 2 +- .../compute/mass_repair_boot_fs.go | 38 -- pkg/cloudbroker/compute/mass_start.go | 2 +- pkg/cloudbroker/compute/mass_stop.go | 2 +- pkg/cloudbroker/compute/migrate.go | 2 +- pkg/cloudbroker/compute/migrate_storage.go | 2 +- .../compute/migrate_storage_abort.go | 2 +- .../compute/migrate_storage_clean_up.go | 2 +- .../compute/migrate_storage_info.go | 2 +- pkg/cloudbroker/compute/models.go | 137 +++++- pkg/cloudbroker/compute/move_to_rg.go | 2 +- pkg/cloudbroker/compute/net_attach.go | 6 +- pkg/cloudbroker/compute/net_detach.go | 2 +- pkg/cloudbroker/compute/net_qos.go | 2 +- pkg/cloudbroker/compute/pause.go | 2 +- pkg/cloudbroker/compute/pfw_add.go | 2 +- pkg/cloudbroker/compute/pfw_del.go | 2 +- pkg/cloudbroker/compute/pfw_list.go | 2 +- pkg/cloudbroker/compute/pin_to_stack.go | 2 +- pkg/cloudbroker/compute/power_cycle.go | 2 +- pkg/cloudbroker/compute/reboot.go | 2 +- pkg/cloudbroker/compute/redeploy.go | 2 +- pkg/cloudbroker/compute/registration.go | 42 -- pkg/cloudbroker/compute/repair_boot_fs.go | 38 -- pkg/cloudbroker/compute/reset.go | 2 +- pkg/cloudbroker/compute/resize.go | 2 +- pkg/cloudbroker/compute/restore.go | 2 +- pkg/cloudbroker/compute/resume.go | 2 +- pkg/cloudbroker/compute/serialize.go | 2 +- pkg/cloudbroker/compute/set_custom_fields.go | 2 +- pkg/cloudbroker/compute/set_net_config.go | 2 +- pkg/cloudbroker/compute/snapshot_create.go | 2 +- pkg/cloudbroker/compute/snapshot_delete.go | 2 +- .../compute/snapshot_evict_disk.go | 2 +- pkg/cloudbroker/compute/snapshot_list.go | 2 +- pkg/cloudbroker/compute/snapshot_rollback.go | 2 +- pkg/cloudbroker/compute/snapshot_usage.go | 2 +- pkg/cloudbroker/compute/sorting.go | 95 +++++ pkg/cloudbroker/compute/start.go | 2 +- pkg/cloudbroker/compute/stop.go | 7 +- pkg/cloudbroker/compute/tag_add.go | 2 +- pkg/cloudbroker/compute/tag_remove.go | 2 +- pkg/cloudbroker/compute/unpin_from_stack.go | 2 +- pkg/cloudbroker/compute/update.go | 33 +- pkg/cloudbroker/compute/user_grant.go | 2 +- pkg/cloudbroker/compute/user_list.go | 2 +- pkg/cloudbroker/compute/user_revoke.go | 2 +- pkg/cloudbroker/compute/user_update.go | 2 +- pkg/cloudbroker/disks.go | 2 +- pkg/cloudbroker/disks/create.go | 17 +- pkg/cloudbroker/disks/delete.go | 6 +- pkg/cloudbroker/disks/delete_disks.go | 2 +- pkg/cloudbroker/disks/depresent.go | 2 +- pkg/cloudbroker/disks/disks.go | 2 +- pkg/cloudbroker/disks/filter.go | 6 +- pkg/cloudbroker/disks/filter_test.go | 32 +- pkg/cloudbroker/disks/from_platform_disk.go | 6 +- pkg/cloudbroker/disks/get.go | 2 +- pkg/cloudbroker/disks/limit_io.go | 2 +- pkg/cloudbroker/disks/list.go | 2 +- pkg/cloudbroker/disks/list_deleted.go | 2 +- pkg/cloudbroker/disks/list_types.go | 2 +- pkg/cloudbroker/disks/list_unattached.go | 2 +- pkg/cloudbroker/disks/models.go | 32 +- pkg/cloudbroker/disks/present.go | 2 +- pkg/cloudbroker/disks/rename.go | 2 +- pkg/cloudbroker/disks/replicate.go | 2 +- pkg/cloudbroker/disks/replication_resume.go | 2 +- pkg/cloudbroker/disks/replication_reverse.go | 2 +- pkg/cloudbroker/disks/replication_start.go | 2 +- pkg/cloudbroker/disks/replication_status.go | 2 +- pkg/cloudbroker/disks/replication_stop.go | 2 +- pkg/cloudbroker/disks/replication_suspend.go | 2 +- pkg/cloudbroker/disks/resize.go | 2 +- pkg/cloudbroker/disks/restore.go | 2 +- pkg/cloudbroker/disks/serialize.go | 2 +- pkg/cloudbroker/disks/share.go | 2 +- pkg/cloudbroker/disks/snapshot_delete.go | 2 +- pkg/cloudbroker/disks/snapshot_rollback.go | 2 +- pkg/cloudbroker/disks/unshare.go | 2 +- pkg/cloudbroker/dpdk.go | 2 +- pkg/cloudbroker/dpdknet/create.go | 2 +- pkg/cloudbroker/dpdknet/delete.go | 2 +- pkg/cloudbroker/dpdknet/disable.go | 2 +- pkg/cloudbroker/dpdknet/dpdk.go | 2 +- pkg/cloudbroker/dpdknet/enable.go | 2 +- pkg/cloudbroker/dpdknet/get.go | 2 +- pkg/cloudbroker/dpdknet/list.go | 2 +- pkg/cloudbroker/dpdknet/update.go | 2 +- pkg/cloudbroker/extnet.go | 2 +- pkg/cloudbroker/extnet/access_add.go | 2 +- pkg/cloudbroker/extnet/access_remove.go | 2 +- pkg/cloudbroker/extnet/add_reserved_ip.go | 2 +- pkg/cloudbroker/extnet/create.go | 2 +- pkg/cloudbroker/extnet/default_qos_update.go | 2 +- pkg/cloudbroker/extnet/del_reserved_ip.go | 2 +- pkg/cloudbroker/extnet/destroy.go | 2 +- pkg/cloudbroker/extnet/device_deploy.go | 2 +- pkg/cloudbroker/extnet/device_migrate.go | 2 +- pkg/cloudbroker/extnet/device_remove.go | 2 +- pkg/cloudbroker/extnet/device_restart.go | 2 +- pkg/cloudbroker/extnet/disable.go | 2 +- pkg/cloudbroker/extnet/dns_apply.go | 2 +- pkg/cloudbroker/extnet/enable.go | 2 +- pkg/cloudbroker/extnet/extnet.go | 2 +- pkg/cloudbroker/extnet/get.go | 2 +- pkg/cloudbroker/extnet/get_reserved_ip.go | 2 +- pkg/cloudbroker/extnet/ips_exclude.go | 2 +- pkg/cloudbroker/extnet/ips_exclude_range.go | 2 +- pkg/cloudbroker/extnet/ips_include.go | 2 +- pkg/cloudbroker/extnet/ips_include_range.go | 2 +- pkg/cloudbroker/extnet/list.go | 2 +- pkg/cloudbroker/extnet/models.go | 3 + pkg/cloudbroker/extnet/ntp_apply.go | 2 +- pkg/cloudbroker/extnet/serialize.go | 2 +- pkg/cloudbroker/extnet/set_default.go | 2 +- .../extnet/static_route_access_grant.go | 2 +- .../extnet/static_route_access_revoke.go | 2 +- pkg/cloudbroker/extnet/static_route_add.go | 2 +- pkg/cloudbroker/extnet/static_route_del.go | 2 +- pkg/cloudbroker/extnet/static_route_list.go | 2 +- pkg/cloudbroker/extnet/update.go | 2 +- pkg/cloudbroker/flipgoup.go | 2 +- pkg/cloudbroker/flipgroup/compute_add.go | 2 +- pkg/cloudbroker/flipgroup/compute_remove.go | 2 +- pkg/cloudbroker/flipgroup/create.go | 2 +- pkg/cloudbroker/flipgroup/delete.go | 2 +- pkg/cloudbroker/flipgroup/edit.go | 2 +- pkg/cloudbroker/flipgroup/flipgroup.go | 2 +- pkg/cloudbroker/flipgroup/get.go | 2 +- pkg/cloudbroker/flipgroup/list.go | 2 +- pkg/cloudbroker/flipgroup/serialize.go | 2 +- pkg/cloudbroker/grid.go | 2 +- pkg/cloudbroker/grid/add.go | 2 +- .../grid/add_custom_backup_path.go | 2 +- pkg/cloudbroker/grid/change_settings.go | 2 +- .../grid/execute_maintenance_script.go | 2 +- pkg/cloudbroker/grid/get.go | 2 +- pkg/cloudbroker/grid/get_backup.go | 2 +- pkg/cloudbroker/grid/get_diagnosis.go | 2 +- .../grid/get_resource_consumption.go | 2 +- pkg/cloudbroker/grid/get_settings.go | 2 +- pkg/cloudbroker/grid/grid.go | 2 +- pkg/cloudbroker/grid/list.go | 2 +- pkg/cloudbroker/grid/purge_logs.go | 2 +- .../grid/remove_custom_backup_path.go | 2 +- pkg/cloudbroker/grid/rename.go | 2 +- pkg/cloudbroker/grid/serialize.go | 2 +- pkg/cloudbroker/grid/services_restart.go | 2 +- .../grid/set_cpu_allocation_parameter.go | 2 +- .../grid/set_cpu_allocation_ratio.go | 2 +- .../grid/set_cpu_allocation_ratio_for_vm.go | 2 +- .../grid/set_mem_allocation_ratio.go | 2 +- pkg/cloudbroker/grid/set_password_policy.go | 2 +- pkg/cloudbroker/group.go | 2 +- pkg/cloudbroker/group/get.go | 2 +- pkg/cloudbroker/group/group.go | 2 +- pkg/cloudbroker/group/list.go | 2 +- pkg/cloudbroker/image.go | 2 +- pkg/cloudbroker/image/computeci_set.go | 2 +- pkg/cloudbroker/image/computeci_unset.go | 2 +- pkg/cloudbroker/image/create_cdrom_image.go | 6 +- pkg/cloudbroker/image/create_image.go | 6 +- pkg/cloudbroker/image/create_virtual.go | 2 +- pkg/cloudbroker/image/delete.go | 2 +- pkg/cloudbroker/image/delete_cdrom_image.go | 2 +- pkg/cloudbroker/image/delete_images.go | 2 +- pkg/cloudbroker/image/disable.go | 2 +- pkg/cloudbroker/image/edit.go | 2 +- pkg/cloudbroker/image/enable.go | 2 +- pkg/cloudbroker/image/filter_test.go | 6 +- pkg/cloudbroker/image/get.go | 2 +- pkg/cloudbroker/image/grant_access.go | 4 +- pkg/cloudbroker/image/image.go | 2 +- pkg/cloudbroker/image/link.go | 2 +- pkg/cloudbroker/image/list.go | 2 +- pkg/cloudbroker/image/list_stacks.go | 2 +- pkg/cloudbroker/image/models.go | 4 +- pkg/cloudbroker/image/rename.go | 2 +- pkg/cloudbroker/image/revoke_access.go | 4 +- pkg/cloudbroker/image/serialize.go | 2 +- pkg/cloudbroker/image/share.go | 2 +- pkg/cloudbroker/image/sync_create_image.go | 2 +- pkg/cloudbroker/image/update_nodes.go | 2 +- pkg/cloudbroker/image/upload_image_file.go | 39 -- pkg/cloudbroker/k8ci.go | 2 +- pkg/cloudbroker/k8ci/access_add.go | 2 +- pkg/cloudbroker/k8ci/access_remove.go | 2 +- pkg/cloudbroker/k8ci/create.go | 2 +- pkg/cloudbroker/k8ci/delete.go | 2 +- pkg/cloudbroker/k8ci/disable.go | 2 +- pkg/cloudbroker/k8ci/enable.go | 2 +- pkg/cloudbroker/k8ci/get.go | 2 +- pkg/cloudbroker/k8ci/k8ci.go | 2 +- pkg/cloudbroker/k8ci/list.go | 2 +- pkg/cloudbroker/k8ci/list_deleted.go | 2 +- pkg/cloudbroker/k8ci/restore.go | 2 +- pkg/cloudbroker/k8ci/serialize.go | 2 +- pkg/cloudbroker/k8s.go | 2 +- pkg/cloudbroker/k8s/create.go | 2 +- pkg/cloudbroker/k8s/delete.go | 2 +- .../k8s/delete_master_from_group.go | 2 +- .../k8s/delete_worker_from_group.go | 2 +- pkg/cloudbroker/k8s/disable.go | 2 +- pkg/cloudbroker/k8s/enable.go | 2 +- pkg/cloudbroker/k8s/find_group_by_label.go | 2 +- pkg/cloudbroker/k8s/get.go | 2 +- pkg/cloudbroker/k8s/get_config.go | 2 +- pkg/cloudbroker/k8s/get_node_annotations.go | 2 +- pkg/cloudbroker/k8s/get_node_labels.go | 2 +- pkg/cloudbroker/k8s/get_node_taints.go | 2 +- .../k8s/get_worker_nodes_meta_data.go | 2 +- pkg/cloudbroker/k8s/k8s.go | 2 +- pkg/cloudbroker/k8s/list.go | 2 +- pkg/cloudbroker/k8s/list_deleted.go | 2 +- pkg/cloudbroker/k8s/models.go | 3 + pkg/cloudbroker/k8s/restore.go | 2 +- pkg/cloudbroker/k8s/serialize.go | 2 +- pkg/cloudbroker/k8s/start.go | 2 +- pkg/cloudbroker/k8s/stop.go | 2 +- pkg/cloudbroker/k8s/update.go | 2 +- .../k8s/update_worker_nodes_meta_data.go | 2 +- pkg/cloudbroker/k8s/worker_add.go | 2 +- pkg/cloudbroker/k8s/worker_reset.go | 2 +- pkg/cloudbroker/k8s/worker_restart.go | 2 +- pkg/cloudbroker/k8s/workers_group_add.go | 2 +- pkg/cloudbroker/k8s/workers_group_delete.go | 2 +- .../k8s/workers_group_get_by_name.go | 2 +- pkg/cloudbroker/kvmx86.go | 2 +- pkg/cloudbroker/kvmx86/create.go | 6 +- pkg/cloudbroker/kvmx86/create_blank.go | 18 +- pkg/cloudbroker/kvmx86/kvmx86.go | 2 +- pkg/cloudbroker/kvmx86/mass_create.go | 2 +- pkg/cloudbroker/lb.go | 2 +- pkg/cloudbroker/lb/backend_create.go | 2 +- pkg/cloudbroker/lb/backend_delete.go | 2 +- pkg/cloudbroker/lb/backend_server_add.go | 2 +- pkg/cloudbroker/lb/backend_server_delete.go | 2 +- pkg/cloudbroker/lb/backend_server_update.go | 2 +- pkg/cloudbroker/lb/backend_update.go | 2 +- pkg/cloudbroker/lb/config_reset.go | 2 +- pkg/cloudbroker/lb/create.go | 2 +- pkg/cloudbroker/lb/delete.go | 2 +- pkg/cloudbroker/lb/disable.go | 2 +- pkg/cloudbroker/lb/enable.go | 2 +- pkg/cloudbroker/lb/filter.go | 4 +- pkg/cloudbroker/lb/frontend_bind.go | 2 +- pkg/cloudbroker/lb/frontend_bind_delete.go | 2 +- pkg/cloudbroker/lb/frontend_binding_update.go | 2 +- pkg/cloudbroker/lb/frontend_create.go | 2 +- pkg/cloudbroker/lb/frontend_delete.go | 2 +- pkg/cloudbroker/lb/get.go | 2 +- pkg/cloudbroker/lb/lb.go | 2 +- pkg/cloudbroker/lb/list.go | 2 +- pkg/cloudbroker/lb/list_deleted.go | 2 +- pkg/cloudbroker/lb/make_highly_available.go | 2 +- pkg/cloudbroker/lb/restart.go | 2 +- pkg/cloudbroker/lb/restore.go | 2 +- pkg/cloudbroker/lb/serialize.go | 2 +- pkg/cloudbroker/lb/start.go | 2 +- pkg/cloudbroker/lb/stop.go | 2 +- pkg/cloudbroker/lb/update.go | 2 +- pkg/cloudbroker/lb/update_sysctl_params.go | 2 +- pkg/cloudbroker/node.go | 2 +- pkg/cloudbroker/node/apply_ipmi_action.go | 2 +- pkg/cloudbroker/node/consumption.go | 2 +- pkg/cloudbroker/node/decommission.go | 2 +- pkg/cloudbroker/node/enable.go | 2 +- pkg/cloudbroker/node/enable_nodes.go | 6 +- pkg/cloudbroker/node/get.go | 2 +- pkg/cloudbroker/node/list.go | 2 +- pkg/cloudbroker/node/maintenance.go | 6 +- pkg/cloudbroker/node/models.go | 2 +- pkg/cloudbroker/node/node.go | 2 +- pkg/cloudbroker/node/restrict.go | 2 +- pkg/cloudbroker/node/serialize.go | 2 +- pkg/cloudbroker/node/set_core_isolation.go | 2 +- pkg/cloudbroker/node/set_huge_pages.go | 2 +- pkg/cloudbroker/node/set_sriov_status.go | 2 +- pkg/cloudbroker/node/set_vfs_number.go | 27 +- pkg/cloudbroker/node/set_vfs_params.go | 61 +++ pkg/cloudbroker/node/update.go | 2 +- pkg/cloudbroker/pcidevice.go | 2 +- pkg/cloudbroker/pcidevice/create.go | 2 +- pkg/cloudbroker/pcidevice/delete.go | 2 +- pkg/cloudbroker/pcidevice/disable.go | 2 +- pkg/cloudbroker/pcidevice/enable.go | 2 +- pkg/cloudbroker/pcidevice/list.go | 2 +- pkg/cloudbroker/pcidevice/pcidevice.go | 2 +- pkg/cloudbroker/pcidevice/serialize.go | 2 +- pkg/cloudbroker/prometheus.go | 2 +- .../prometheus/compute_cpu_load.go | 2 +- .../prometheus/compute_memory_available.go | 4 +- .../prometheus/compute_memory_unused.go | 4 +- .../prometheus/compute_memory_usable.go | 4 +- .../prometheus/compute_memory_usage.go | 4 +- .../prometheus/compute_memory_used.go | 4 +- .../prometheus/compute_read_bytes.go | 6 +- .../prometheus/compute_read_requests.go | 6 +- .../prometheus/compute_receive_bytes.go | 6 +- .../prometheus/compute_receive_packets.go | 6 +- .../prometheus/compute_transmit_bytes.go | 6 +- .../prometheus/compute_transmit_packets.go | 6 +- .../prometheus/compute_write_bytes.go | 6 +- .../prometheus/compute_write_requests.go | 6 +- pkg/cloudbroker/prometheus/computes.go | 77 ++++ pkg/cloudbroker/prometheus/models.go | 27 ++ pkg/cloudbroker/prometheus/prometheus.go | 2 +- pkg/cloudbroker/resmon.go | 2 +- pkg/cloudbroker/resmon/get_by_compute.go | 2 +- pkg/cloudbroker/resmon/get_by_computes.go | 2 +- pkg/cloudbroker/resmon/get_by_grid.go | 2 +- pkg/cloudbroker/resmon/get_by_stack.go | 2 +- pkg/cloudbroker/resmon/get_by_stacks.go | 2 +- pkg/cloudbroker/resmon/models.go | 10 +- pkg/cloudbroker/resmon/resmon.go | 2 +- pkg/cloudbroker/rg.go | 2 +- pkg/cloudbroker/rg/access_grant.go | 2 +- pkg/cloudbroker/rg/access_revoke.go | 2 +- pkg/cloudbroker/rg/affinity_group_computes.go | 2 +- pkg/cloudbroker/rg/affinity_groups_get.go | 2 +- pkg/cloudbroker/rg/affinity_groups_list.go | 2 +- pkg/cloudbroker/rg/audits.go | 2 +- pkg/cloudbroker/rg/create.go | 8 +- pkg/cloudbroker/rg/delete.go | 2 +- pkg/cloudbroker/rg/disable.go | 2 +- pkg/cloudbroker/rg/enable.go | 2 +- pkg/cloudbroker/rg/filter_test.go | 81 ++-- pkg/cloudbroker/rg/get.go | 2 +- .../rg/get_resource_consumption.go | 2 +- pkg/cloudbroker/rg/list.go | 2 +- pkg/cloudbroker/rg/list_computes.go | 2 +- pkg/cloudbroker/rg/list_deleted.go | 2 +- pkg/cloudbroker/rg/list_lb.go | 2 +- pkg/cloudbroker/rg/list_pfw.go | 2 +- pkg/cloudbroker/rg/list_vins.go | 2 +- pkg/cloudbroker/rg/mass_delete.go | 2 +- pkg/cloudbroker/rg/mass_disable.go | 2 +- pkg/cloudbroker/rg/mass_enable.go | 2 +- pkg/cloudbroker/rg/models.go | 3 - pkg/cloudbroker/rg/remove_def_net.go | 2 +- pkg/cloudbroker/rg/restore.go | 2 +- pkg/cloudbroker/rg/rg.go | 2 +- pkg/cloudbroker/rg/serialize.go | 2 +- .../rg/set_cpu_allocation_parameter.go | 2 +- .../rg/set_cpu_allocation_ratio.go | 2 +- pkg/cloudbroker/rg/set_def_net.go | 2 +- pkg/cloudbroker/rg/update.go | 6 +- pkg/cloudbroker/rg/update_compute_features.go | 4 +- pkg/cloudbroker/rg/update_resource_types.go | 2 +- pkg/cloudbroker/rg/usage.go | 2 +- pkg/cloudbroker/sep.go | 2 +- pkg/cloudbroker/sep/access_grant.go | 2 +- pkg/cloudbroker/sep/access_grant_to_pool.go | 2 +- pkg/cloudbroker/sep/access_revoke.go | 2 +- pkg/cloudbroker/sep/access_revoke_to_pool.go | 2 +- pkg/cloudbroker/sep/add_consumer_nodes.go | 2 +- pkg/cloudbroker/sep/add_pool.go | 2 +- pkg/cloudbroker/sep/add_provider_nodes.go | 2 +- pkg/cloudbroker/sep/config_field_edit.go | 2 +- pkg/cloudbroker/sep/config_insert.go | 2 +- pkg/cloudbroker/sep/config_validate.go | 2 +- pkg/cloudbroker/sep/consumption.go | 2 +- pkg/cloudbroker/sep/create.go | 2 +- pkg/cloudbroker/sep/decommission.go | 2 +- pkg/cloudbroker/sep/del_consumer_nodes.go | 7 +- pkg/cloudbroker/sep/del_pool.go | 2 +- pkg/cloudbroker/sep/delete.go | 2 +- pkg/cloudbroker/sep/disable.go | 2 +- pkg/cloudbroker/sep/disk_list.go | 2 +- pkg/cloudbroker/sep/enable.go | 2 +- pkg/cloudbroker/sep/filter.go | 82 ++++ pkg/cloudbroker/sep/filter_test.go | 137 +++++- pkg/cloudbroker/sep/get.go | 2 +- pkg/cloudbroker/sep/get_config.go | 2 +- pkg/cloudbroker/sep/get_pool.go | 2 +- pkg/cloudbroker/sep/get_template.go | 36 ++ pkg/cloudbroker/sep/list.go | 2 +- .../sep/list_available_sep_and_pools.go | 51 +++ pkg/cloudbroker/sep/models.go | 33 ++ pkg/cloudbroker/sep/sep.go | 2 +- pkg/cloudbroker/sep/serialize.go | 38 +- pkg/cloudbroker/sep/shared_lock_start.go | 2 +- pkg/cloudbroker/sep/shared_lock_stop.go | 2 +- pkg/cloudbroker/stack.go | 2 +- pkg/cloudbroker/stack/get.go | 2 +- .../stack/get_logical_cores_count.go | 2 +- pkg/cloudbroker/stack/list.go | 2 +- pkg/cloudbroker/stack/models.go | 14 +- .../stack/set_cpu_allocation_ratio.go | 2 +- .../stack/set_mem_allocation_ratio.go | 2 +- pkg/cloudbroker/stack/stack.go | 2 +- pkg/cloudbroker/tasks.go | 2 +- pkg/cloudbroker/tasks/get.go | 2 +- pkg/cloudbroker/tasks/list.go | 2 +- pkg/cloudbroker/tasks/tasks.go | 2 +- pkg/cloudbroker/user.go | 2 +- pkg/cloudbroker/user/api_list.go | 2 +- pkg/cloudbroker/user/apiaccess_join.go | 2 +- pkg/cloudbroker/user/apiaccess_leave.go | 2 +- pkg/cloudbroker/user/apiaccess_list.go | 2 +- pkg/cloudbroker/user/create.go | 2 +- pkg/cloudbroker/user/delete.go | 2 +- pkg/cloudbroker/user/delete_by_guid.go | 2 +- pkg/cloudbroker/user/delete_users.go | 2 +- pkg/cloudbroker/user/get.go | 2 +- .../user/get_matching_usernames.go | 2 +- pkg/cloudbroker/user/list.go | 2 +- pkg/cloudbroker/user/user.go | 2 +- pkg/cloudbroker/vfpool.go | 2 +- pkg/cloudbroker/vfpool/create.go | 2 +- pkg/cloudbroker/vfpool/delete.go | 2 +- pkg/cloudbroker/vfpool/disable.go | 2 +- pkg/cloudbroker/vfpool/enable.go | 2 +- pkg/cloudbroker/vfpool/get.go | 2 +- pkg/cloudbroker/vfpool/list.go | 2 +- pkg/cloudbroker/vfpool/serialize.go | 2 +- pkg/cloudbroker/vfpool/update.go | 2 +- pkg/cloudbroker/vfpool/vfpool.go | 2 +- pkg/cloudbroker/vgpu.go | 2 +- pkg/cloudbroker/vgpu/allocate.go | 2 +- pkg/cloudbroker/vgpu/create.go | 2 +- pkg/cloudbroker/vgpu/deallocate.go | 2 +- pkg/cloudbroker/vgpu/destroy.go | 2 +- pkg/cloudbroker/vgpu/list.go | 2 +- pkg/cloudbroker/vgpu/serialize.go | 2 +- pkg/cloudbroker/vgpu/vgpu.go | 2 +- pkg/cloudbroker/vins.go | 2 +- pkg/cloudbroker/vins/audits.go | 2 +- pkg/cloudbroker/vins/create_in_account.go | 2 +- pkg/cloudbroker/vins/create_in_rg.go | 2 +- pkg/cloudbroker/vins/default_qos_update.go | 2 +- pkg/cloudbroker/vins/delete.go | 2 +- pkg/cloudbroker/vins/disable.go | 2 +- pkg/cloudbroker/vins/dns_apply.go | 2 +- pkg/cloudbroker/vins/enable.go | 2 +- pkg/cloudbroker/vins/extnet_connect.go | 2 +- pkg/cloudbroker/vins/extnet_disconnect.go | 2 +- pkg/cloudbroker/vins/extnet_list.go | 2 +- pkg/cloudbroker/vins/get.go | 2 +- pkg/cloudbroker/vins/ip_list.go | 2 +- pkg/cloudbroker/vins/ip_release.go | 2 +- pkg/cloudbroker/vins/ip_reserve.go | 2 +- pkg/cloudbroker/vins/list.go | 6 +- pkg/cloudbroker/vins/list_deleted.go | 2 +- pkg/cloudbroker/vins/mass_delete.go | 2 +- pkg/cloudbroker/vins/mass_disable.go | 2 +- pkg/cloudbroker/vins/mass_enable.go | 2 +- pkg/cloudbroker/vins/nat_rule_add.go | 2 +- pkg/cloudbroker/vins/nat_rule_del.go | 2 +- pkg/cloudbroker/vins/nat_rule_list.go | 2 +- pkg/cloudbroker/vins/net_qos.go | 2 +- pkg/cloudbroker/vins/restore.go | 2 +- pkg/cloudbroker/vins/serialize.go | 2 +- .../vins/static_route_access_grant.go | 2 +- .../vins/static_route_access_revoke.go | 2 +- pkg/cloudbroker/vins/static_route_add.go | 2 +- pkg/cloudbroker/vins/static_route_del.go | 2 +- pkg/cloudbroker/vins/static_route_list.go | 2 +- pkg/cloudbroker/vins/vins.go | 2 +- pkg/cloudbroker/vins/vnfdev_redeploy.go | 2 +- pkg/cloudbroker/vins/vnfdev_reset.go | 2 +- pkg/cloudbroker/vins/vnfdev_restart.go | 2 +- pkg/cloudbroker/vins/vnfdev_start.go | 2 +- pkg/cloudbroker/vins/vnfdev_stop.go | 2 +- universal-client.go | 6 +- 1022 files changed, 6438 insertions(+), 1686 deletions(-) create mode 100644 check.go delete mode 100644 pkg/cloudapi/account/create.go create mode 100644 pkg/cloudapi/compute/change_mac.go create mode 100644 pkg/cloudapi/prometheus.go create mode 100644 pkg/cloudapi/prometheus/compute_cpu_load.go create mode 100644 pkg/cloudapi/prometheus/compute_memory_available.go create mode 100644 pkg/cloudapi/prometheus/compute_memory_unused.go create mode 100644 pkg/cloudapi/prometheus/compute_memory_usable.go create mode 100644 pkg/cloudapi/prometheus/compute_memory_usage.go create mode 100644 pkg/cloudapi/prometheus/compute_memory_used.go create mode 100644 pkg/cloudapi/prometheus/compute_read_bytes.go create mode 100644 pkg/cloudapi/prometheus/compute_read_requests.go create mode 100644 pkg/cloudapi/prometheus/compute_receive_bytes.go create mode 100644 pkg/cloudapi/prometheus/compute_receive_packets.go create mode 100644 pkg/cloudapi/prometheus/compute_transmit_bytes.go create mode 100644 pkg/cloudapi/prometheus/compute_transmit_packets.go create mode 100644 pkg/cloudapi/prometheus/compute_write_bytes.go create mode 100644 pkg/cloudapi/prometheus/compute_write_requests.go create mode 100644 pkg/cloudapi/prometheus/computes.go create mode 100644 pkg/cloudapi/prometheus/models.go create mode 100644 pkg/cloudapi/prometheus/prometheus.go create mode 100644 pkg/cloudapi/sep.go create mode 100644 pkg/cloudapi/sep/filter.go create mode 100644 pkg/cloudapi/sep/filter_test.go create mode 100644 pkg/cloudapi/sep/ids.go create mode 100644 pkg/cloudapi/sep/list_available_sep_and_pools.go create mode 100644 pkg/cloudapi/sep/models.go create mode 100644 pkg/cloudapi/sep/sep.go create mode 100644 pkg/cloudapi/sep/serialize.go rename pkg/cloudbroker/apiaccess/{get_pre_groups.go => get_default.go} (50%) delete mode 100644 pkg/cloudbroker/apiaccess/list_deleted.go create mode 100644 pkg/cloudbroker/bservice.go create mode 100644 pkg/cloudbroker/bservice/bservice.go create mode 100644 pkg/cloudbroker/bservice/create.go create mode 100644 pkg/cloudbroker/bservice/delete.go create mode 100644 pkg/cloudbroker/bservice/disable.go create mode 100644 pkg/cloudbroker/bservice/enable.go create mode 100644 pkg/cloudbroker/bservice/filter.go create mode 100644 pkg/cloudbroker/bservice/filter_test.go create mode 100644 pkg/cloudbroker/bservice/get.go create mode 100644 pkg/cloudbroker/bservice/group_add.go create mode 100644 pkg/cloudbroker/bservice/group_compute_remove.go create mode 100644 pkg/cloudbroker/bservice/group_get.go create mode 100644 pkg/cloudbroker/bservice/group_parent_remove.go create mode 100644 pkg/cloudbroker/bservice/group_parrent_add.go create mode 100644 pkg/cloudbroker/bservice/group_remove.go create mode 100644 pkg/cloudbroker/bservice/group_resize.go create mode 100644 pkg/cloudbroker/bservice/group_start.go create mode 100644 pkg/cloudbroker/bservice/group_stop.go create mode 100644 pkg/cloudbroker/bservice/group_update.go create mode 100644 pkg/cloudbroker/bservice/group_update_extnet.go create mode 100644 pkg/cloudbroker/bservice/group_update_vins.go create mode 100644 pkg/cloudbroker/bservice/list.go create mode 100644 pkg/cloudbroker/bservice/list_deleted.go create mode 100644 pkg/cloudbroker/bservice/models.go create mode 100644 pkg/cloudbroker/bservice/restore.go create mode 100644 pkg/cloudbroker/bservice/snapshot_create.go create mode 100644 pkg/cloudbroker/bservice/snapshot_delete.go create mode 100644 pkg/cloudbroker/bservice/snapshot_list.go create mode 100644 pkg/cloudbroker/bservice/snapshot_rollback.go create mode 100644 pkg/cloudbroker/bservice/sorting.go create mode 100644 pkg/cloudbroker/bservice/start.go create mode 100644 pkg/cloudbroker/bservice/stop.go create mode 100644 pkg/cloudbroker/compute/change_mac.go delete mode 100644 pkg/cloudbroker/compute/mass_repair_boot_fs.go delete mode 100644 pkg/cloudbroker/compute/registration.go delete mode 100644 pkg/cloudbroker/compute/repair_boot_fs.go delete mode 100644 pkg/cloudbroker/image/upload_image_file.go create mode 100644 pkg/cloudbroker/node/set_vfs_params.go create mode 100644 pkg/cloudbroker/prometheus/computes.go create mode 100644 pkg/cloudbroker/sep/get_template.go create mode 100644 pkg/cloudbroker/sep/list_available_sep_and_pools.go diff --git a/README.md b/README.md index 1929d89..441bdca 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Dynamix SDK - это библиотека, написанная на языке - Версия 9.0.х Dynamix-SDK соответствует 4.1.0 версии платформы - Версия 10.0.х Dynamix-SDK соответствует 4.2.0 версии платформы + - Версия 11.0.х Dynamix-SDK соответствует 4.3.0 версии платформы ## Оглавление @@ -75,7 +76,7 @@ Dynamix SDK - это библиотека, написанная на языке Выполните команду в терминале: ```bash -go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v10 +go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v11 ``` ## Список API @@ -104,7 +105,9 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v10 - `KVMx86` - создание виртуальной машины x86; - `LB` - управление балансировщиками нагрузки; - `Locations` - получение информации о grid площадки; +- `Prometheus` - получение статистики prometheus; - `RG` - управление ресурсными группами аккаунта; +- `SEP` - управление storage endpoint (sep); - `Stack` - получение информации о вычислительных узлах; - `Tasks` - получение информации о ходе выполнения асинхронных задач (например, создание кластера); - `VFPool` - управление пулом виртуальных сетевых функций; @@ -173,7 +176,7 @@ go get -u repository.basistech.ru/BASIS/dynamix-golang-sdk/v10 ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main(){ @@ -198,7 +201,7 @@ func main(){ ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main() { @@ -214,7 +217,7 @@ func main() { "appId": "", "appSecret": "", "ssoUrl": "https://sso.digitalenergy.online", - "Url": "https://mr4.digitalenergy.online", + "decortUrl": "https://mr4.digitalenergy.online", "retries": 5, "timeout": "5m", "sslSkipVerify": false @@ -227,7 +230,7 @@ func main() { appId: appSecret: ssoUrl: https://sso.digitalenergy.online -Url: https://mr4.digitalenergy.online +decortUrl: https://mr4.digitalenergy.online retries: 5 timeout: 5m sslSkipVerify: false @@ -235,7 +238,7 @@ sslSkipVerify: false ### Создание клиента -Создание клиента происходит с помощью функции-строителя `New` из основного пакета `dynamix-sdk`, для избежания проблем с именами, пакету можно присвоить алиас ``. Функция принимает конфигурацию, возвращает структуру `Client`, с помощью которой можно взаимодействовать с платформой. +Создание клиента происходит с помощью функции-строителя `New` из основного пакета `decort-sdk`, для избежания проблем с именами, пакету можно присвоить алиас `decort`. Функция принимает конфигурацию, возвращает структуру `DecortClient`, с помощью которой можно взаимодействовать с платформой. ### Пример @@ -243,8 +246,8 @@ sslSkipVerify: false package main import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -253,14 +256,14 @@ func main() { AppID: "", AppSecret: "", SSOURL: "https://sso.digitalenergy.online", - URL: "https://mr4.digitalenergy.online", + DecortURL: "https://mr4.digitalenergy.online", Retries: 5, } cfg.SetTimeout(5 * time.Minute) // Создание клиента - client := .New(cfg) + client := decort.New(cfg) } ``` @@ -288,7 +291,9 @@ func main() { - `pkg/cloudapi/kvmx86` - для `KVMX86` - `pkg/cloudapi/lb` - для `LB` - `pkg/cloudapi/locations` - для `Locations` + - `pkg/cloudapi/prometheus` - для `Prometheus` - `pkg/cloudapi/rg` - для `RG` + - `pkg/cloudapi/sep` - для `SEP` - `pkg/cloudapi/stack` - для `Stack` - `pkg/cloudapi/tasks` - для `Tasks` - `pkg/cloudapi/vfpool` - для `VFPool` @@ -421,9 +426,9 @@ type CreateRequest struct { package main import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/kvmx86" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/kvmx86" ) func main() { @@ -432,7 +437,7 @@ func main() { AppID: "", AppSecret: "", SSOURL: "https://sso.digitalenergy.online", - URL: "https://mr4.digitalenergy.online", + DecortURL: "https://mr4.digitalenergy.online", Retries: 5, } @@ -474,8 +479,9 @@ func main() { - `.KVMx86()` - для работы с `KVMX86` - `.LB()` - для работы с `LB` - `.Locations()` - для работы с `Locations` + - `.Prometheus()` - для работы с `Prometheus` - `.RG()` - для работы с `RG` - - `.Resmon()` - для работы с `Resmon` + - `.SEP()` - для работы с `SEP` - `.Stack()` - для работы с `Stack` - `.Tasks()` - для работы с `Tasks` - `.VFPool()` - для работы с `VFPool` @@ -536,9 +542,9 @@ import ( "log" "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/kvmx86" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/kvmx86" ) func main() { @@ -586,9 +592,9 @@ import ( "log" "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/account" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/account" ) func main() { @@ -766,9 +772,9 @@ import ( "context" "log" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/compute" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/compute" ) func main() { @@ -824,9 +830,9 @@ import ( "log" "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/bservice" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/bservice" ) func main() { @@ -870,7 +876,7 @@ func main() { - ToString(): строковое представление результата выполнения задачи - ID() и Name(): получение ID и имени созданного в результате выполнения задачи ресурса - ToMaps(): получение списка карт, содержащих информацию о дисках, восстановленных в результате выполнения задачи. -Все методы оборудованы возвратом ошибок. Непустая ошибка означает, что из поля Result нельзя получить информацию, которую предоставляет метод. + Все методы оборудованы возвратом ошибок. Непустая ошибка означает, что из поля Result нельзя получить информацию, которую предоставляет метод. ```go package main @@ -879,10 +885,10 @@ import ( "log" "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/tasks" - tasks_cb "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/tasks" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/tasks" + tasks_cb "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/tasks" ) func main() { @@ -962,7 +968,7 @@ func main() { ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main(){ @@ -986,7 +992,7 @@ func main(){ ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main() { @@ -1027,8 +1033,8 @@ sslSkipVerify: true package main import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1055,8 +1061,8 @@ package main import ( "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1138,7 +1144,7 @@ func main() { ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main(){ @@ -1166,7 +1172,7 @@ func main(){ ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main() { @@ -1183,7 +1189,7 @@ func main() { ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main() { @@ -1249,8 +1255,8 @@ func main() { package main import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1283,8 +1289,8 @@ package main import ( "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1324,8 +1330,8 @@ package main import ( "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1363,8 +1369,8 @@ package main import ( "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1417,11 +1423,11 @@ import ( "log" "os" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/kvmx86" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/kvmx86" ) func main() { @@ -1477,13 +1483,13 @@ func main() { | BVSConfig | *BVSConfig | Нет | Конфигурация BVS | | LegacyConfig | string | Нет | Конфигурация Legacy | -В универсальном клиенте можно использовать только один тип конфигурации одновременно. +В универсальном клиенте можно использовать только один тип конфигурации одновременно. #### Пример конфигурации универсального клиента ```go import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" ) func main(){ @@ -1516,8 +1522,8 @@ func main(){ package main import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1548,8 +1554,8 @@ package main import ( "fmt" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + decort "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11" ) func main() { @@ -1589,4 +1595,36 @@ func main() { fmt.Println(res) } +``` + + +## Проверка соответствия версии платформы и версии dynamix + +С версии v1.11.0 для каждого клиента добавлен метод `Check` для проверки соответствия decort-sdk и платформы dynamix. +В случае соответсвия decort-sdk и платформы dynamix возвращается структура, содержащая информацию о версии и актуальном билде платформы. + +#### Пример выполнения запроса + +```go +import ( + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" +) + +func main(){ + // Настройка конфигурации + config := config.Config{ + AppID: "", + AppSecret: "", + SSOURL: "https://sso.digitalenergy.online", + DecortURL: "https://mr4.digitalenergy.online", + Retries: 5, + SSLSkipVerify: true, + } + + // Создание клиента + client := decort.New(config) + + // Проверка соответствия версии + checkInfo, err := client.Check() +} ``` \ No newline at end of file diff --git a/check.go b/check.go new file mode 100644 index 0000000..356038a --- /dev/null +++ b/check.go @@ -0,0 +1,88 @@ +package decortsdk + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants" +) + +type CheckInfo struct { + Version string `json:"version"` + Build uint64 `json:"build"` +} + +const versionURL = "/system/info/version" + +func (de DecortClient) Check() (*CheckInfo, error) { + res, err := de.DecortApiCall(context.Background(), http.MethodGet, versionURL, nil) + if err != nil { + return nil, err + } + + info := CheckInfo{} + + err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info) + if err != nil { + return nil, err + } + + if v, ok := constants.VersionMap[info.Version]; ok { + if v == "-" { + return &info, nil + } + return nil, errors.New(fmt.Sprintf("SDK don't support platform version %s, please use %s SDK version", info.Version, v)) + } + + return nil, errors.New(fmt.Sprintf("platform version %s isn't supported", info.Version)) +} + +func (bvs BVSDecortClient) Check() (*CheckInfo, error) { + res, err := bvs.DecortApiCall(context.Background(), http.MethodGet, versionURL, nil) + if err != nil { + return nil, err + } + + info := CheckInfo{} + + err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info) + if err != nil { + return nil, err + } + + if v, ok := constants.VersionMap[info.Version]; ok { + if v == "-" { + return &info, nil + } + return nil, errors.New(fmt.Sprintf("SDK don't support platform version %s, please use %s SDK version", info.Version, v)) + } + + return nil, errors.New(fmt.Sprintf("platform version %s isn't supported", info.Version)) +} + +func (ldc LegacyDecortClient) Check() (*CheckInfo, error) { + res, err := ldc.DecortApiCall(context.Background(), http.MethodGet, versionURL, nil) + if err != nil { + return nil, err + } + + info := CheckInfo{} + + err = json.Unmarshal([]byte(strings.Replace(strings.Trim(string(res), `"`), "\\", "", -1)), &info) + if err != nil { + return nil, err + } + + if v, ok := constants.VersionMap[info.Version]; ok { + if v == "-" { + return &info, nil + } + return nil, errors.New(fmt.Sprintf("SDK don't support platform version %s, please use %s SDK version", info.Version, v)) + } + + return nil, errors.New(fmt.Sprintf("platform version %s isn't supported", info.Version)) +} diff --git a/client.go b/client.go index 4a97953..2970c5b 100644 --- a/client.go +++ b/client.go @@ -16,11 +16,11 @@ import ( "time" "github.com/google/go-querystring/query" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker" ) // DecortClient is HTTP-client for platform diff --git a/client_bvs.go b/client_bvs.go index bbb14a5..9bf11f6 100644 --- a/client_bvs.go +++ b/client_bvs.go @@ -14,10 +14,10 @@ import ( "time" "github.com/google/go-querystring/query" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker" ) // BVSDecortClient is HTTP-client for platform diff --git a/config/config.go b/config/config.go index da39fa9..a968e35 100644 --- a/config/config.go +++ b/config/config.go @@ -6,7 +6,7 @@ import ( "time" "gopkg.in/yaml.v3" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // Configuration for creating request to platform diff --git a/config/config_bvs.go b/config/config_bvs.go index 6c50135..0a6891e 100644 --- a/config/config_bvs.go +++ b/config/config_bvs.go @@ -6,8 +6,8 @@ import ( "time" "gopkg.in/yaml.v3" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type BVSConfig struct { diff --git a/config/legacy-config.go b/config/legacy-config.go index 77df19b..32ec48a 100644 --- a/config/legacy-config.go +++ b/config/legacy-config.go @@ -6,7 +6,7 @@ import ( "time" "gopkg.in/yaml.v3" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // Legacy client configuration diff --git a/go.mod b/go.mod index c1da83a..eed5e22 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module repository.basistech.ru/BASIS/dynamix-golang-sdk/v10 +module repository.basistech.ru/BASIS/dynamix-golang-sdk/v11 go 1.20 diff --git a/internal/constants/constants.go b/internal/constants/constants.go index 3ce48de..4ebc2e3 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -12,3 +12,7 @@ var FileName = map[string]string{ } var K8sValues = []string{"labels", "taints", "annotations, additionalSANs"} + +var VersionMap = map[string]string{ + "4.3.0": "-", +} diff --git a/internal/validators/custom.go b/internal/validators/custom.go index 678fcb8..8c2c4a3 100644 --- a/internal/validators/custom.go +++ b/internal/validators/custom.go @@ -9,8 +9,8 @@ import ( "strings" "github.com/go-playground/validator/v10" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/multierror" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/multierror" ) // computeDriverValidator is used to validate Driver field in kvmx86 create. @@ -27,6 +27,13 @@ func protoValidator(fe validator.FieldLevel) bool { return IsInSlice(fieldValue, protoValues) } +// apiGroupValidator is used to validate APIGroup fields +func apiGroupValidator(fe validator.FieldLevel) bool { + fieldValue := fe.Field().String() + + return IsInSlice(fieldValue, apiGroupValues) +} + // accessTypeValidator is used to validate AccessType fields. func accessTypeValidator(fe validator.FieldLevel) bool { fieldValue := fe.Field().String() @@ -393,6 +400,27 @@ func preferredCPUValidator(fe validator.FieldLevel) bool { return true } +// loaderTypeValidator is used to validate loaderType fields +func loaderTypeValidator(fe validator.FieldLevel) bool { + fieldValue := fe.Field().String() + + return IsInSlice(fieldValue, loaderTypeValues) +} + +// languageValidator is used to validate language fields +func languageValidator(fe validator.FieldLevel) bool { + fieldValue := fe.Field().String() + + return IsInSlice(fieldValue, languageValues) +} + +// sepTypeValidator is used to validate sepType fields +func sepTypeValidator(fe validator.FieldLevel) bool { + fieldValue := fe.Field().String() + + return IsInSlice(fieldValue, sepTypeValues) +} + // ValidateRAM checks if request contains RAM value that is positive integer divisible by divisibility passed. // It is recommended to pass constants.RAM_DIVISIBILITY as divisility arguement func ValidateRAM(r interfaces.RequestWithRAM, divisibility uint64) error { diff --git a/internal/validators/helper.go b/internal/validators/helper.go index 1282ab1..633b977 100644 --- a/internal/validators/helper.go +++ b/internal/validators/helper.go @@ -3,7 +3,7 @@ package validators import ( "errors" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/multierror" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/multierror" "github.com/go-playground/validator/v10" ) diff --git a/internal/validators/messages.go b/internal/validators/messages.go index 3ec169b..9f558ef 100644 --- a/internal/validators/messages.go +++ b/internal/validators/messages.go @@ -52,6 +52,13 @@ func errorMessage(fe validator.FieldError) string { fe.Field(), joinValues(protoValues)) + // apiGroup Validators + case "apiGroup": + return fmt.Sprintf("%s %s must be one of the following: %s", + prefix, + fe.Field(), + joinValues(apiGroupValues)) + // Account Validators case "accountCUType": return fmt.Sprintf("%s %s must be one of the following: %s", @@ -308,6 +315,24 @@ func errorMessage(fe validator.FieldError) string { prefix, fe.Field(), joinValues(chipsetValues)) + + case "loaderType": + return fmt.Sprintf("%s %s must be one of the following: %s", + prefix, + fe.Field(), + joinValues(loaderTypeValues)) + + case "language": + return fmt.Sprintf("%s %s must be one of the following: %s", + prefix, + fe.Field(), + joinValues(languageValues)) + + case "sepType": + return fmt.Sprintf("%s %s must be one of the following: %s", + prefix, + fe.Field(), + joinValues(sepTypeValues)) } return fe.Error() diff --git a/internal/validators/validator.go b/internal/validators/validator.go index 49f295a..5e9cf29 100644 --- a/internal/validators/validator.go +++ b/internal/validators/validator.go @@ -36,6 +36,11 @@ func registerAllValidators(validate *validator.Validate) error { return err } + err = validate.RegisterValidation("apiGroup", apiGroupValidator) + if err != nil { + return err + } + err = validate.RegisterValidation("accessType", accessTypeValidator) if err != nil { return err @@ -266,5 +271,20 @@ func registerAllValidators(validate *validator.Validate) error { return err } + err = validate.RegisterValidation("loaderType", loaderTypeValidator) + if err != nil { + return err + } + + err = validate.RegisterValidation("language", languageValidator) + if err != nil { + return err + } + + err = validate.RegisterValidation("sepType", sepTypeValidator) + if err != nil { + return err + } + return nil } diff --git a/internal/validators/values.go b/internal/validators/values.go index 219fd52..1d30630 100644 --- a/internal/validators/values.go +++ b/internal/validators/values.go @@ -1,6 +1,8 @@ package validators var ( + apiGroupValues = []string{"cloudapi", "cloudbroker", "system"} + driverValues = []string{"KVM_X86"} accessTypeValues = []string{"R", "RCX", "ARCXDU"} resTypesValues = []string{"compute", "vins", "k8s", "openshift", "lb", "flipgroup"} @@ -35,7 +37,7 @@ var ( vinsTypeValues = []string{"DHCP", "VIP", "EXCLUDED"} imageBootTypeValues = []string{"uefi", "bios"} - imageTypeValues = []string{"windows", "linux", "other"} + imageTypeValues = []string{"windows", "linux", "unknown"} imageDriversValues = []string{"KVM_X86"} imageArchitectureValues = []string{"X86_64"} @@ -51,7 +53,7 @@ var ( vmActionValues = []string{"stop", "move"} - computeFeaturesValues = []string{"hugepages", "numa", "cpupin", "vfnic"} + computeFeaturesValues = []string{"hugepages", "numa", "cpupin", "vfnic", "dpdk", "changemac"} networkInterfaceNamingValues = []string{"eth", "ens"} @@ -64,6 +66,12 @@ var ( eventIDxValues = []string{"on", "off", "selected by hypervisor"} chipsetValues = []string{"i440fx", "Q35"} + + loaderTypeValues = []string{"linux", "windows", "unknown"} + + sepTypeValues = []string{"hitachi", "dorado", "tatlin", "shared", "local", "des"} + + languageValues = []string{"ru", "en"} ) const ( diff --git a/legacy-client.go b/legacy-client.go index 893a863..4a49447 100644 --- a/legacy-client.go +++ b/legacy-client.go @@ -13,10 +13,10 @@ import ( "time" "github.com/google/go-querystring/query" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/constants" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/constants" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker" ) // LegacyDecortClient is Legacy HTTP-client for platform diff --git a/pkg/cloudapi/account.go b/pkg/cloudapi/account.go index 59ccff7..da15e3e 100644 --- a/pkg/cloudapi/account.go +++ b/pkg/cloudapi/account.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/account" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/account" ) // Accessing the Account method group diff --git a/pkg/cloudapi/account/account.go b/pkg/cloudapi/account/account.go index ff312fd..6a21575 100644 --- a/pkg/cloudapi/account/account.go +++ b/pkg/cloudapi/account/account.go @@ -2,7 +2,7 @@ package account import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to account diff --git a/pkg/cloudapi/account/add_user.go b/pkg/cloudapi/account/add_user.go index 19b9825..c90a19d 100644 --- a/pkg/cloudapi/account/add_user.go +++ b/pkg/cloudapi/account/add_user.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddUserRequest struct to add permission to access account for a user diff --git a/pkg/cloudapi/account/audits.go b/pkg/cloudapi/account/audits.go index 5fef1e9..36a0510 100644 --- a/pkg/cloudapi/account/audits.go +++ b/pkg/cloudapi/account/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to give list of account audits diff --git a/pkg/cloudapi/account/create.go b/pkg/cloudapi/account/create.go deleted file mode 100644 index d39a9dc..0000000 --- a/pkg/cloudapi/account/create.go +++ /dev/null @@ -1,75 +0,0 @@ -package account - -import ( - "context" - "net/http" - "strconv" - - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" -) - -// CreateRequest struct for creating account -type CreateRequest struct { - // Display name - // Required: true - Name string `url:"name" json:"name" validate:"required"` - - // Name of the account - // Required: true - Username string `url:"username" json:"username" validate:"required"` - - // Email - // Required: false - EmailAddress string `url:"emailaddress,omitempty" json:"emailaddress,omitempty" validate:"omitempty,email"` - - // Max size of memory in MB - // Required: false - MaxMemoryCapacity int64 `url:"maxMemoryCapacity,omitempty" json:"maxMemoryCapacity,omitempty"` - - // Max size of aggregated vdisks in GB - // Required: false - MaxVDiskCapacity int64 `url:"maxVDiskCapacity,omitempty" json:"maxVDiskCapacity,omitempty"` - - // Max number of CPU cores - // Required: false - MaxCPUCapacity int64 `url:"maxCPUCapacity,omitempty" json:"maxCPUCapacity,omitempty"` - - // Max sent/received network transfer peering - // Required: false - MaxNetworkPeerTransfer int64 `url:"maxNetworkPeerTransfer,omitempty" json:"maxNetworkPeerTransfer,omitempty"` - - // Max number of assigned public IPs - // Required: false - MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"` - - // If true send emails when a user is granted access to resources - // Required: false - SendAccessEmails bool `url:"sendAccessEmails" json:"sendAccessEmails"` - - // Limit (positive) or disable (0) GPU resources - // Required: false - GPUUnits int64 `url:"gpu_units,omitempty" json:"gpu_units,omitempty"` -} - -// Create creates account -// Setting a cloud unit maximum to -1 or empty will not put any restrictions on the resource -func (a Account) Create(ctx context.Context, req CreateRequest) (uint64, error) { - err := validators.ValidateRequest(req) - if err != nil { - return 0, validators.ValidationErrors(validators.GetErrors(err)) - } - - url := "/cloudapi/account/create" - - res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req) - if err != nil { - return 0, err - } - - result, err := strconv.ParseUint(string(res), 10, 64) - if err != nil { - return 0, err - } - - return result, nil -} diff --git a/pkg/cloudapi/account/delete.go b/pkg/cloudapi/account/delete.go index 6e17aae..ebcf121 100644 --- a/pkg/cloudapi/account/delete.go +++ b/pkg/cloudapi/account/delete.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete account diff --git a/pkg/cloudapi/account/delete_user.go b/pkg/cloudapi/account/delete_user.go index f04de7b..06e6794 100644 --- a/pkg/cloudapi/account/delete_user.go +++ b/pkg/cloudapi/account/delete_user.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteUserRequest struct to revoke access to account diff --git a/pkg/cloudapi/account/disable_enable.go b/pkg/cloudapi/account/disable_enable.go index 476f9f2..6d93f0f 100644 --- a/pkg/cloudapi/account/disable_enable.go +++ b/pkg/cloudapi/account/disable_enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableEnableRequest struct to change status of account @@ -13,6 +13,10 @@ type DisableEnableRequest struct { // ID of account // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` + + // Reason of disabling + // Required: false + Reason string `url:"reason,omitempty" json:"reason,omitempty"` } // Disable disables an account diff --git a/pkg/cloudapi/account/get.go b/pkg/cloudapi/account/get.go index 17e0a74..d7b5efc 100644 --- a/pkg/cloudapi/account/get.go +++ b/pkg/cloudapi/account/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about account diff --git a/pkg/cloudapi/account/get_consumed_account_units.go b/pkg/cloudapi/account/get_consumed_account_units.go index eef44fb..31b0c00 100644 --- a/pkg/cloudapi/account/get_consumed_account_units.go +++ b/pkg/cloudapi/account/get_consumed_account_units.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetConsumedAccountUnitsRequest struct to calculate the currently consumed units for all cloudspaces and resource groups in the account diff --git a/pkg/cloudapi/account/get_consumed_cloud_units_by_type.go b/pkg/cloudapi/account/get_consumed_cloud_units_by_type.go index 55a559d..82d9ea0 100644 --- a/pkg/cloudapi/account/get_consumed_cloud_units_by_type.go +++ b/pkg/cloudapi/account/get_consumed_cloud_units_by_type.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetConsumedCloudUnitsByTypeRequest struct to calculate the currently consumed cloud units of the specified type for all cloudspaces and resource groups in the account diff --git a/pkg/cloudapi/account/get_reserved_account_units.go b/pkg/cloudapi/account/get_reserved_account_units.go index 05937d0..1137feb 100644 --- a/pkg/cloudapi/account/get_reserved_account_units.go +++ b/pkg/cloudapi/account/get_reserved_account_units.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetReservedAccountUnitsRequest struct to calculate the reserved units for all cloudspaces and resource groups in the account diff --git a/pkg/cloudapi/account/get_resource_consumption.go b/pkg/cloudapi/account/get_resource_consumption.go index de23720..2f59fac 100644 --- a/pkg/cloudapi/account/get_resource_consumption.go +++ b/pkg/cloudapi/account/get_resource_consumption.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetResourceConsumptionRequest struct to get resource consumption diff --git a/pkg/cloudapi/account/list.go b/pkg/cloudapi/account/list.go index 25254d3..2bbd105 100644 --- a/pkg/cloudapi/account/list.go +++ b/pkg/cloudapi/account/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of accounts diff --git a/pkg/cloudapi/account/list_computes.go b/pkg/cloudapi/account/list_computes.go index 497e91e..2ca60e6 100644 --- a/pkg/cloudapi/account/list_computes.go +++ b/pkg/cloudapi/account/list_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListComputesRequest struct to get a list of compute instances diff --git a/pkg/cloudapi/account/list_deleted.go b/pkg/cloudapi/account/list_deleted.go index 2854704..8d76a48 100644 --- a/pkg/cloudapi/account/list_deleted.go +++ b/pkg/cloudapi/account/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get a list of deleted accounts diff --git a/pkg/cloudapi/account/list_disks.go b/pkg/cloudapi/account/list_disks.go index e1be28c..6ee8476 100644 --- a/pkg/cloudapi/account/list_disks.go +++ b/pkg/cloudapi/account/list_disks.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDisksRequest struct to get a list of deleted disks diff --git a/pkg/cloudapi/account/list_flipgroups.go b/pkg/cloudapi/account/list_flipgroups.go index d12c2f8..fb9dfd3 100644 --- a/pkg/cloudapi/account/list_flipgroups.go +++ b/pkg/cloudapi/account/list_flipgroups.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListFLIPGroupsRequest struct to get a list of FLIPGroups diff --git a/pkg/cloudapi/account/list_rg.go b/pkg/cloudapi/account/list_rg.go index c92398b..f3b97a1 100644 --- a/pkg/cloudapi/account/list_rg.go +++ b/pkg/cloudapi/account/list_rg.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRGRequest struct to get a list of resource groups diff --git a/pkg/cloudapi/account/list_templates.go b/pkg/cloudapi/account/list_templates.go index c676633..2eadd95 100644 --- a/pkg/cloudapi/account/list_templates.go +++ b/pkg/cloudapi/account/list_templates.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListTemplatesRequest struct to get a list of templates diff --git a/pkg/cloudapi/account/list_vins.go b/pkg/cloudapi/account/list_vins.go index 8303a02..8a7163b 100644 --- a/pkg/cloudapi/account/list_vins.go +++ b/pkg/cloudapi/account/list_vins.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListVINSRequest struct to get a list of VINS diff --git a/pkg/cloudapi/account/models.go b/pkg/cloudapi/account/models.go index f68b7e9..019058e 100644 --- a/pkg/cloudapi/account/models.go +++ b/pkg/cloudapi/account/models.go @@ -62,6 +62,9 @@ type ItemAccount struct { // Deleted time DeletedTime uint64 `json:"deletedTime"` + // Description + Description string `json:"desc"` + // ID ID uint64 `json:"id"` @@ -197,6 +200,9 @@ type RecordAccount struct { // Created time CreatedTime uint64 `json:"createdTime"` + // Description + Description string `json:"desc"` + // Deactivation time DeactivationTime float64 `json:"deactivationTime"` @@ -512,6 +518,9 @@ type ItemRG struct { // Deleted time DeletedTime uint64 `json:"deletedTime"` + // Description + Description string `json:"desc"` + // Resource group ID RGID uint64 `json:"id"` diff --git a/pkg/cloudapi/account/restore.go b/pkg/cloudapi/account/restore.go index fad6657..1c08481 100644 --- a/pkg/cloudapi/account/restore.go +++ b/pkg/cloudapi/account/restore.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore a deleted account diff --git a/pkg/cloudapi/account/serialize.go b/pkg/cloudapi/account/serialize.go index 3e219f0..55d3141 100644 --- a/pkg/cloudapi/account/serialize.go +++ b/pkg/cloudapi/account/serialize.go @@ -3,7 +3,7 @@ package account import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/account/update.go b/pkg/cloudapi/account/update.go index 6c2ad70..94d3691 100644 --- a/pkg/cloudapi/account/update.go +++ b/pkg/cloudapi/account/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update account @@ -14,6 +14,10 @@ type UpdateRequest struct { // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` + // Description + // Required: false + Description string `url:"desc,omitempty" json:"desc,omitempty"` + // Name of the account // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` diff --git a/pkg/cloudapi/account/update_user.go b/pkg/cloudapi/account/update_user.go index 386f932..35013c6 100644 --- a/pkg/cloudapi/account/update_user.go +++ b/pkg/cloudapi/account/update_user.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateUserRequest struct to update user access rights diff --git a/pkg/cloudapi/audit.go b/pkg/cloudapi/audit.go index d371de7..a101f58 100644 --- a/pkg/cloudapi/audit.go +++ b/pkg/cloudapi/audit.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/audit" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/audit" ) // Accessing the Stack method group diff --git a/pkg/cloudapi/audit/audit.go b/pkg/cloudapi/audit/audit.go index c099d42..b2647e8 100644 --- a/pkg/cloudapi/audit/audit.go +++ b/pkg/cloudapi/audit/audit.go @@ -1,6 +1,6 @@ package audit -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to audit type Audit struct { diff --git a/pkg/cloudapi/audit/get.go b/pkg/cloudapi/audit/get.go index f09562f..0b976b5 100644 --- a/pkg/cloudapi/audit/get.go +++ b/pkg/cloudapi/audit/get.go @@ -5,14 +5,14 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about account type GetRequest struct { // Audit GUID // Required: true - AuditGuid string `url:"auditGuid" json:"auditGuid" validate:"required"` + AuditGuid string `url:"audit_guid" json:"audit_guid" validate:"required"` } // Get gets information about audit as a RecordAudit struct diff --git a/pkg/cloudapi/bservice.go b/pkg/cloudapi/bservice.go index 4631f8e..815579e 100644 --- a/pkg/cloudapi/bservice.go +++ b/pkg/cloudapi/bservice.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/bservice" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/bservice" // Accessing the BService method group func (ca *CloudAPI) BService() *bservice.BService { diff --git a/pkg/cloudapi/bservice/bservice.go b/pkg/cloudapi/bservice/bservice.go index 8051532..b2c91e4 100644 --- a/pkg/cloudapi/bservice/bservice.go +++ b/pkg/cloudapi/bservice/bservice.go @@ -1,7 +1,7 @@ // API Actor for managing Compute Group. This actor is a final API for endusers to manage Compute Group package bservice -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to bservice type BService struct { diff --git a/pkg/cloudapi/bservice/create.go b/pkg/cloudapi/bservice/create.go index 79ef592..252cb8d 100644 --- a/pkg/cloudapi/bservice/create.go +++ b/pkg/cloudapi/bservice/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct for BasicService diff --git a/pkg/cloudapi/bservice/delete.go b/pkg/cloudapi/bservice/delete.go index e674278..b91cffc 100644 --- a/pkg/cloudapi/bservice/delete.go +++ b/pkg/cloudapi/bservice/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete basic service diff --git a/pkg/cloudapi/bservice/disable.go b/pkg/cloudapi/bservice/disable.go index 0bac581..e81dfb6 100644 --- a/pkg/cloudapi/bservice/disable.go +++ b/pkg/cloudapi/bservice/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct for disable service diff --git a/pkg/cloudapi/bservice/enable.go b/pkg/cloudapi/bservice/enable.go index ce09efa..6b36878 100644 --- a/pkg/cloudapi/bservice/enable.go +++ b/pkg/cloudapi/bservice/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to disable service diff --git a/pkg/cloudapi/bservice/get.go b/pkg/cloudapi/bservice/get.go index ef5d7d3..27f23a5 100644 --- a/pkg/cloudapi/bservice/get.go +++ b/pkg/cloudapi/bservice/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about service diff --git a/pkg/cloudapi/bservice/group_add.go b/pkg/cloudapi/bservice/group_add.go index 2fde07b..2d3c516 100644 --- a/pkg/cloudapi/bservice/group_add.go +++ b/pkg/cloudapi/bservice/group_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupAddRequest struct to create new compute group within BasicService @@ -71,6 +71,10 @@ type GroupAddRequest struct { // Meta data for working group computes, format YAML "user_data": 1111 // Required: false UserData string `url:"userData,omitempty" json:"userData,omitempty"` + + //Chipset "i440fx" or "Q35 + //Required: false + Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset,omitempty"` } // GetRAM returns RAM field values diff --git a/pkg/cloudapi/bservice/group_compute_remove.go b/pkg/cloudapi/bservice/group_compute_remove.go index 032925f..76a7c66 100644 --- a/pkg/cloudapi/bservice/group_compute_remove.go +++ b/pkg/cloudapi/bservice/group_compute_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupComputeRemoveRequest struct to remove group compute diff --git a/pkg/cloudapi/bservice/group_get.go b/pkg/cloudapi/bservice/group_get.go index 973537c..405cd22 100644 --- a/pkg/cloudapi/bservice/group_get.go +++ b/pkg/cloudapi/bservice/group_get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupGetRequest struct to get detailed information about Compute Group diff --git a/pkg/cloudapi/bservice/group_parent_add.go b/pkg/cloudapi/bservice/group_parent_add.go index bad33b7..275e502 100644 --- a/pkg/cloudapi/bservice/group_parent_add.go +++ b/pkg/cloudapi/bservice/group_parent_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupParentAddRequest struct to add parent Compute Group relation to the specified Compute Group diff --git a/pkg/cloudapi/bservice/group_parent_remove.go b/pkg/cloudapi/bservice/group_parent_remove.go index 5134646..131b9dd 100644 --- a/pkg/cloudapi/bservice/group_parent_remove.go +++ b/pkg/cloudapi/bservice/group_parent_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupParentRemoveRequest struct to remove parent Compute Group diff --git a/pkg/cloudapi/bservice/group_remove.go b/pkg/cloudapi/bservice/group_remove.go index 0d311c0..6525134 100644 --- a/pkg/cloudapi/bservice/group_remove.go +++ b/pkg/cloudapi/bservice/group_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupRemoveRequest struct for destroy the specified Compute Group diff --git a/pkg/cloudapi/bservice/group_resize.go b/pkg/cloudapi/bservice/group_resize.go index 69dc1ab..4eaf984 100644 --- a/pkg/cloudapi/bservice/group_resize.go +++ b/pkg/cloudapi/bservice/group_resize.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupResizeRequest struct to resize the group @@ -22,6 +22,12 @@ type GroupResizeRequest struct { // Required: true Count int64 `url:"count" json:"count" validate:"required"` + //Chipset for new computes, either i440fx or Q35 (i440fx by default) + //Available values : i440fx, Q35 + //Default value : i440fx + //Required: true + Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"` + // Either delta or absolute value of computes // Should be one of: // - ABSOLUTE diff --git a/pkg/cloudapi/bservice/group_start.go b/pkg/cloudapi/bservice/group_start.go index a96d8c7..4e612e8 100644 --- a/pkg/cloudapi/bservice/group_start.go +++ b/pkg/cloudapi/bservice/group_start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupStartRequest struct to start the specified Compute Group diff --git a/pkg/cloudapi/bservice/group_stop.go b/pkg/cloudapi/bservice/group_stop.go index 9c05602..bd11577 100644 --- a/pkg/cloudapi/bservice/group_stop.go +++ b/pkg/cloudapi/bservice/group_stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupStopRequest struct to stop the specified Compute Group diff --git a/pkg/cloudapi/bservice/group_update.go b/pkg/cloudapi/bservice/group_update.go index 902f4ab..28c1e8c 100644 --- a/pkg/cloudapi/bservice/group_update.go +++ b/pkg/cloudapi/bservice/group_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupUpdateRequest struct to update existing Compute group diff --git a/pkg/cloudapi/bservice/group_update_extnet.go b/pkg/cloudapi/bservice/group_update_extnet.go index 74d2f6a..47f2961 100644 --- a/pkg/cloudapi/bservice/group_update_extnet.go +++ b/pkg/cloudapi/bservice/group_update_extnet.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupUpdateExtNetRequest struct to update External Network settings diff --git a/pkg/cloudapi/bservice/group_update_vins.go b/pkg/cloudapi/bservice/group_update_vins.go index a3170a1..c918e9a 100644 --- a/pkg/cloudapi/bservice/group_update_vins.go +++ b/pkg/cloudapi/bservice/group_update_vins.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GroupUpdateVINSRequest struct to update VINS settings diff --git a/pkg/cloudapi/bservice/list.go b/pkg/cloudapi/bservice/list.go index ef4ea02..ec2899b 100644 --- a/pkg/cloudapi/bservice/list.go +++ b/pkg/cloudapi/bservice/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of BasicService instances diff --git a/pkg/cloudapi/bservice/list_deleted.go b/pkg/cloudapi/bservice/list_deleted.go index 21dc33a..aeb73ce 100644 --- a/pkg/cloudapi/bservice/list_deleted.go +++ b/pkg/cloudapi/bservice/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted BasicService instances diff --git a/pkg/cloudapi/bservice/models.go b/pkg/cloudapi/bservice/models.go index ab50f75..86e6416 100644 --- a/pkg/cloudapi/bservice/models.go +++ b/pkg/cloudapi/bservice/models.go @@ -295,6 +295,9 @@ type ItemGroupCompute struct { // List of information about OS Users OSUsers ListOSUsers `json:"osUsers"` + + //Chipset + Chipset string `json:"chipset"` } // List of Group Computes diff --git a/pkg/cloudapi/bservice/restore.go b/pkg/cloudapi/bservice/restore.go index da63a58..3b51941 100644 --- a/pkg/cloudapi/bservice/restore.go +++ b/pkg/cloudapi/bservice/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore BasicService instance diff --git a/pkg/cloudapi/bservice/serialize.go b/pkg/cloudapi/bservice/serialize.go index 7f5afe9..07c8130 100644 --- a/pkg/cloudapi/bservice/serialize.go +++ b/pkg/cloudapi/bservice/serialize.go @@ -3,7 +3,7 @@ package bservice import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/bservice/snapshot_create.go b/pkg/cloudapi/bservice/snapshot_create.go index bb3c2a7..64827ae 100644 --- a/pkg/cloudapi/bservice/snapshot_create.go +++ b/pkg/cloudapi/bservice/snapshot_create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotCreateRequest struct to create snapshot diff --git a/pkg/cloudapi/bservice/snapshot_delete.go b/pkg/cloudapi/bservice/snapshot_delete.go index 6f5e2ab..22582df 100644 --- a/pkg/cloudapi/bservice/snapshot_delete.go +++ b/pkg/cloudapi/bservice/snapshot_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotDeleteRequest struct to delete snapshot diff --git a/pkg/cloudapi/bservice/snapshot_list.go b/pkg/cloudapi/bservice/snapshot_list.go index de4a7e9..4b51d21 100644 --- a/pkg/cloudapi/bservice/snapshot_list.go +++ b/pkg/cloudapi/bservice/snapshot_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotListRequest struct to get list of existing snapshots diff --git a/pkg/cloudapi/bservice/snapshot_rollback.go b/pkg/cloudapi/bservice/snapshot_rollback.go index ecf22d1..70378a0 100644 --- a/pkg/cloudapi/bservice/snapshot_rollback.go +++ b/pkg/cloudapi/bservice/snapshot_rollback.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotRollbackRequest struct to rollback snapshot diff --git a/pkg/cloudapi/bservice/start.go b/pkg/cloudapi/bservice/start.go index 60d7e7b..767a30a 100644 --- a/pkg/cloudapi/bservice/start.go +++ b/pkg/cloudapi/bservice/start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StartRequest struct to start service diff --git a/pkg/cloudapi/bservice/stop.go b/pkg/cloudapi/bservice/stop.go index c39f5d7..bdc8bc2 100644 --- a/pkg/cloudapi/bservice/stop.go +++ b/pkg/cloudapi/bservice/stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StopRequest struct to stop service diff --git a/pkg/cloudapi/cloudapi.go b/pkg/cloudapi/cloudapi.go index 47c474d..86e1898 100644 --- a/pkg/cloudapi/cloudapi.go +++ b/pkg/cloudapi/cloudapi.go @@ -2,7 +2,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to CloudAPI groups diff --git a/pkg/cloudapi/compute.go b/pkg/cloudapi/compute.go index 2a1f594..a8c2b4c 100644 --- a/pkg/cloudapi/compute.go +++ b/pkg/cloudapi/compute.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/compute" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/compute" ) // Accessing the Compute method group diff --git a/pkg/cloudapi/compute/affinity_group_check_start.go b/pkg/cloudapi/compute/affinity_group_check_start.go index bca628a..8df0f81 100644 --- a/pkg/cloudapi/compute/affinity_group_check_start.go +++ b/pkg/cloudapi/compute/affinity_group_check_start.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupCheckStartRequest struct to check all computes with current affinity label can start diff --git a/pkg/cloudapi/compute/affinity_label_remove.go b/pkg/cloudapi/compute/affinity_label_remove.go index 8cca7ea..22f67e4 100644 --- a/pkg/cloudapi/compute/affinity_label_remove.go +++ b/pkg/cloudapi/compute/affinity_label_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityLabelRemoveRequest struct to clear affinity label for compute diff --git a/pkg/cloudapi/compute/affinity_label_set.go b/pkg/cloudapi/compute/affinity_label_set.go index 0692bc7..6e058b2 100644 --- a/pkg/cloudapi/compute/affinity_label_set.go +++ b/pkg/cloudapi/compute/affinity_label_set.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityLabelSetRequest struct to set affinity label for compute diff --git a/pkg/cloudapi/compute/affinity_relations.go b/pkg/cloudapi/compute/affinity_relations.go index c1e4a33..99b4a9b 100644 --- a/pkg/cloudapi/compute/affinity_relations.go +++ b/pkg/cloudapi/compute/affinity_relations.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRelationsRequest struct to get dict of computes diff --git a/pkg/cloudapi/compute/affinity_rule_add.go b/pkg/cloudapi/compute/affinity_rule_add.go index 115d964..53aad32 100644 --- a/pkg/cloudapi/compute/affinity_rule_add.go +++ b/pkg/cloudapi/compute/affinity_rule_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRuleAddRequest struct to add affinity rule diff --git a/pkg/cloudapi/compute/affinity_rule_remove.go b/pkg/cloudapi/compute/affinity_rule_remove.go index c0dc88e..8be8c1c 100644 --- a/pkg/cloudapi/compute/affinity_rule_remove.go +++ b/pkg/cloudapi/compute/affinity_rule_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRuleRemoveRequest struct to remove affinity rule diff --git a/pkg/cloudapi/compute/affinity_rules_clear.go b/pkg/cloudapi/compute/affinity_rules_clear.go index fa97033..6dcdd0e 100644 --- a/pkg/cloudapi/compute/affinity_rules_clear.go +++ b/pkg/cloudapi/compute/affinity_rules_clear.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRulesClearRequest struct to clear affinity rules diff --git a/pkg/cloudapi/compute/anti_affinity_rule_add.go b/pkg/cloudapi/compute/anti_affinity_rule_add.go index c35aff1..c27973b 100644 --- a/pkg/cloudapi/compute/anti_affinity_rule_add.go +++ b/pkg/cloudapi/compute/anti_affinity_rule_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AntiAffinityRuleAddRequest struct to add anti affinity rule diff --git a/pkg/cloudapi/compute/anti_affinity_rule_remove.go b/pkg/cloudapi/compute/anti_affinity_rule_remove.go index 06ea137..b1bdc5d 100644 --- a/pkg/cloudapi/compute/anti_affinity_rule_remove.go +++ b/pkg/cloudapi/compute/anti_affinity_rule_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AntiAffinityRuleRemoveRequest struct to remove anti affinity rule diff --git a/pkg/cloudapi/compute/anti_affinity_rules_clear.go b/pkg/cloudapi/compute/anti_affinity_rules_clear.go index a9fed8a..20d090e 100644 --- a/pkg/cloudapi/compute/anti_affinity_rules_clear.go +++ b/pkg/cloudapi/compute/anti_affinity_rules_clear.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AntiAffinityRulesClearRequest struct to clear anti affinity rules diff --git a/pkg/cloudapi/compute/attach_gpu.go b/pkg/cloudapi/compute/attach_gpu.go index 14a2be9..9cfe17e 100644 --- a/pkg/cloudapi/compute/attach_gpu.go +++ b/pkg/cloudapi/compute/attach_gpu.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AttachGPURequest struct to attach GPU for compute diff --git a/pkg/cloudapi/compute/attach_pci_device.go b/pkg/cloudapi/compute/attach_pci_device.go index 83dc07e..8b17ca1 100644 --- a/pkg/cloudapi/compute/attach_pci_device.go +++ b/pkg/cloudapi/compute/attach_pci_device.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AttachPCIDeviceRequest struct to attach PCI device diff --git a/pkg/cloudapi/compute/audits.go b/pkg/cloudapi/compute/audits.go index c5672f0..2a8598e 100644 --- a/pkg/cloudapi/compute/audits.go +++ b/pkg/cloudapi/compute/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to get audit records diff --git a/pkg/cloudapi/compute/boot_disk_set.go b/pkg/cloudapi/compute/boot_disk_set.go index 408f281..a28ae23 100644 --- a/pkg/cloudapi/compute/boot_disk_set.go +++ b/pkg/cloudapi/compute/boot_disk_set.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BootDiskSetRequest struct to set boot disk for compute diff --git a/pkg/cloudapi/compute/boot_order_get.go b/pkg/cloudapi/compute/boot_order_get.go index be74ca1..771aa99 100644 --- a/pkg/cloudapi/compute/boot_order_get.go +++ b/pkg/cloudapi/compute/boot_order_get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BootOrderGetRequest struct to get boot order diff --git a/pkg/cloudapi/compute/boot_order_set.go b/pkg/cloudapi/compute/boot_order_set.go index 5c62327..0b130fd 100644 --- a/pkg/cloudapi/compute/boot_order_set.go +++ b/pkg/cloudapi/compute/boot_order_set.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BootOrderSetRequest struct to set boot order diff --git a/pkg/cloudapi/compute/cd_eject.go b/pkg/cloudapi/compute/cd_eject.go index 6962a2c..76d49bf 100644 --- a/pkg/cloudapi/compute/cd_eject.go +++ b/pkg/cloudapi/compute/cd_eject.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CDEjectRequest struct to eject CD image diff --git a/pkg/cloudapi/compute/cd_insert.go b/pkg/cloudapi/compute/cd_insert.go index 1d6413f..f15f3f8 100644 --- a/pkg/cloudapi/compute/cd_insert.go +++ b/pkg/cloudapi/compute/cd_insert.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CDInsertRequest struct to insert new CD image diff --git a/pkg/cloudapi/compute/change_ip.go b/pkg/cloudapi/compute/change_ip.go index 2cde709..64eba42 100644 --- a/pkg/cloudapi/compute/change_ip.go +++ b/pkg/cloudapi/compute/change_ip.go @@ -5,30 +5,30 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ChangeIPRequest struct to change IP for network type ChangeIPRequest struct { // ID of compute instance // Required: true - ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"` // Network type // 'EXTNET' for connect to external network directly // 'VINS' for connect to ViNS // Required: true - NetType string `url:"netType" json:"netType" validate:"computeNetType"` + NetType string `url:"net_type" json:"net_type" validate:"computeNetType"` // Network ID for connect to // For EXTNET - external network ID // For VINS - VINS ID // Required: true - NetID uint64 `url:"netId" json:"netId" validate:"required"` + NetID uint64 `url:"net_id" json:"net_id" validate:"required"` // IP address to which we will change the existing one, it must be from the same subnet // Required: true - IPAddr string `url:"ipAddr" json:"ipAddr" validate:"required"` + IPAddr string `url:"ip_addr" json:"ip_addr" validate:"required"` } // ChangeIP change reserved IP for compute instance diff --git a/pkg/cloudapi/compute/change_link_state.go b/pkg/cloudapi/compute/change_link_state.go index e728380..859bb16 100644 --- a/pkg/cloudapi/compute/change_link_state.go +++ b/pkg/cloudapi/compute/change_link_state.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ChangeLinkStateRequest struct to change link state diff --git a/pkg/cloudapi/compute/change_mac.go b/pkg/cloudapi/compute/change_mac.go new file mode 100644 index 0000000..ff1d05e --- /dev/null +++ b/pkg/cloudapi/compute/change_mac.go @@ -0,0 +1,46 @@ +package compute + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// ChangeMACRequest struct to change MAC for network +type ChangeMACRequest struct { + // ID of compute instance + // Required: true + ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"` + + // Current mac address + // Required: true + СurrentMAC string `url:"current_mac_address" json:"current_mac_address" validate:"required"` + + // the MAC address to which we will change the existing one + // Required: true + NewMAC string `url:"new_mac_address" json:"new_mac_address" validate:"required"` +} + +// ChangeMAC change MAC for compute instance +func (c Compute) ChangeMAC(ctx context.Context, req ChangeMACRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/compute/changeMac" + + res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudapi/compute/clone.go b/pkg/cloudapi/compute/clone.go index 44c8799..d8c12be 100644 --- a/pkg/cloudapi/compute/clone.go +++ b/pkg/cloudapi/compute/clone.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CloneRequest struct to clone compute instance diff --git a/pkg/cloudapi/compute/compute.go b/pkg/cloudapi/compute/compute.go index 7b2b65c..6624483 100644 --- a/pkg/cloudapi/compute/compute.go +++ b/pkg/cloudapi/compute/compute.go @@ -2,7 +2,7 @@ package compute import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to compute diff --git a/pkg/cloudapi/compute/create_template.go b/pkg/cloudapi/compute/create_template.go index 77ff3c3..db62b7d 100644 --- a/pkg/cloudapi/compute/create_template.go +++ b/pkg/cloudapi/compute/create_template.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateTemplateRequest struct to create template diff --git a/pkg/cloudapi/compute/create_template_from_blank.go b/pkg/cloudapi/compute/create_template_from_blank.go index 0d50ead..27be19f 100644 --- a/pkg/cloudapi/compute/create_template_from_blank.go +++ b/pkg/cloudapi/compute/create_template_from_blank.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateTemplateFromBlankRequest struct to create template from boot disk of current compute @@ -39,10 +39,6 @@ type CreateTemplateFromBlankRequest struct { // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` - // SEP ID - // Required: false - SepID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"` - // Pool for image create // Required: false PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"` diff --git a/pkg/cloudapi/compute/delete.go b/pkg/cloudapi/compute/delete.go index cf61054..ab01636 100644 --- a/pkg/cloudapi/compute/delete.go +++ b/pkg/cloudapi/compute/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete compute diff --git a/pkg/cloudapi/compute/delete_custom_fields.go b/pkg/cloudapi/compute/delete_custom_fields.go index c17bf3e..7a2a606 100644 --- a/pkg/cloudapi/compute/delete_custom_fields.go +++ b/pkg/cloudapi/compute/delete_custom_fields.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteCustomFieldsRequest struct to delete compute's custom fields diff --git a/pkg/cloudapi/compute/detach_gpu.go b/pkg/cloudapi/compute/detach_gpu.go index 23d9c6a..5228175 100644 --- a/pkg/cloudapi/compute/detach_gpu.go +++ b/pkg/cloudapi/compute/detach_gpu.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DetachGPURequest struct to detach vgpu for compute diff --git a/pkg/cloudapi/compute/detach_pci_device.go b/pkg/cloudapi/compute/detach_pci_device.go index 5c97dd1..6f15b01 100644 --- a/pkg/cloudapi/compute/detach_pci_device.go +++ b/pkg/cloudapi/compute/detach_pci_device.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DetachPCIDeviceRequest struct to detach PCI device diff --git a/pkg/cloudapi/compute/disable.go b/pkg/cloudapi/compute/disable.go index a916757..dd669cb 100644 --- a/pkg/cloudapi/compute/disable.go +++ b/pkg/cloudapi/compute/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable compute diff --git a/pkg/cloudapi/compute/disk_add.go b/pkg/cloudapi/compute/disk_add.go index 6d1adbf..78e0040 100644 --- a/pkg/cloudapi/compute/disk_add.go +++ b/pkg/cloudapi/compute/disk_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskAddRequest struct to create and attach disk to compute diff --git a/pkg/cloudapi/compute/disk_attach.go b/pkg/cloudapi/compute/disk_attach.go index 863c4b2..22f59fa 100644 --- a/pkg/cloudapi/compute/disk_attach.go +++ b/pkg/cloudapi/compute/disk_attach.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskAttachRequest struct to attach disk to compute diff --git a/pkg/cloudapi/compute/disk_del.go b/pkg/cloudapi/compute/disk_del.go index 5aad981..d310c6e 100644 --- a/pkg/cloudapi/compute/disk_del.go +++ b/pkg/cloudapi/compute/disk_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskDelRequest struct to detach and delete disk from compute diff --git a/pkg/cloudapi/compute/disk_detach.go b/pkg/cloudapi/compute/disk_detach.go index b5d46b4..7fe0ac8 100644 --- a/pkg/cloudapi/compute/disk_detach.go +++ b/pkg/cloudapi/compute/disk_detach.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskDetachRequest struct to detach disk from compute diff --git a/pkg/cloudapi/compute/disk_migrate.go b/pkg/cloudapi/compute/disk_migrate.go index 9677d02..7ca9514 100644 --- a/pkg/cloudapi/compute/disk_migrate.go +++ b/pkg/cloudapi/compute/disk_migrate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskMigrateRequest struct to migrate compute's disk to target disk diff --git a/pkg/cloudapi/compute/disk_qos.go b/pkg/cloudapi/compute/disk_qos.go index 31c1309..32178dd 100644 --- a/pkg/cloudapi/compute/disk_qos.go +++ b/pkg/cloudapi/compute/disk_qos.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskQOSRequest struct to change QoS of the disk diff --git a/pkg/cloudapi/compute/disk_resize.go b/pkg/cloudapi/compute/disk_resize.go index 02918e2..d5d11d8 100644 --- a/pkg/cloudapi/compute/disk_resize.go +++ b/pkg/cloudapi/compute/disk_resize.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskResizeRequest struct to change disk size diff --git a/pkg/cloudapi/compute/disk_switch_to_replication.go b/pkg/cloudapi/compute/disk_switch_to_replication.go index c074217..666ac3a 100644 --- a/pkg/cloudapi/compute/disk_switch_to_replication.go +++ b/pkg/cloudapi/compute/disk_switch_to_replication.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskSwitchToReplicationRequest struct to switch disk to it's replication diff --git a/pkg/cloudapi/compute/enable.go b/pkg/cloudapi/compute/enable.go index a443521..b8c7509 100644 --- a/pkg/cloudapi/compute/enable.go +++ b/pkg/cloudapi/compute/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable compute diff --git a/pkg/cloudapi/compute/filter.go b/pkg/cloudapi/compute/filter.go index 900dd94..7465439 100644 --- a/pkg/cloudapi/compute/filter.go +++ b/pkg/cloudapi/compute/filter.go @@ -3,9 +3,9 @@ package compute import ( "context" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/k8s" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/lb" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/lb" ) // FilterByID returns ListComputes with specified ID. diff --git a/pkg/cloudapi/compute/filter_test.go b/pkg/cloudapi/compute/filter_test.go index 7f2c1fe..513d2a9 100644 --- a/pkg/cloudapi/compute/filter_test.go +++ b/pkg/cloudapi/compute/filter_test.go @@ -48,8 +48,7 @@ var computes = ListComputes{ Devices: nil, Disks: []InfoDisk{ { - ID: 65191, - PCISlot: 6, + ID: 65191, }, }, Driver: "KVM_X86", @@ -64,7 +63,7 @@ var computes = ListComputes{ MigrationJob: 0, Milestones: 363500, Name: "test", - Pinned: false, + PinnedToStack: true, RAM: 4096, ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e", Registered: true, @@ -111,8 +110,7 @@ var computes = ListComputes{ Devices: nil, Disks: []InfoDisk{ { - ID: 65248, - PCISlot: 6, + ID: 65248, }, }, Driver: "KVM_X86", @@ -127,10 +125,10 @@ var computes = ListComputes{ MigrationJob: 0, Milestones: 363853, Name: "compute_2", - Pinned: false, RAM: 4096, ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff", Registered: true, + PinnedToStack: true, ResName: "compute-48556", RGID: 79727, RGName: "sdk_negative_fields_test", diff --git a/pkg/cloudapi/compute/get.go b/pkg/cloudapi/compute/get.go index 6c4d550..8117404 100644 --- a/pkg/cloudapi/compute/get.go +++ b/pkg/cloudapi/compute/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about compute diff --git a/pkg/cloudapi/compute/get_audits.go b/pkg/cloudapi/compute/get_audits.go index d853429..d9d52b4 100644 --- a/pkg/cloudapi/compute/get_audits.go +++ b/pkg/cloudapi/compute/get_audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetAuditsRequest struct to get compute audits diff --git a/pkg/cloudapi/compute/get_console_url.go b/pkg/cloudapi/compute/get_console_url.go index 25acb40..5bc4c5f 100644 --- a/pkg/cloudapi/compute/get_console_url.go +++ b/pkg/cloudapi/compute/get_console_url.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetConsoleURLRequest struct to get console URL diff --git a/pkg/cloudapi/compute/get_custom_fields.go b/pkg/cloudapi/compute/get_custom_fields.go index 63c06fe..553e4fd 100644 --- a/pkg/cloudapi/compute/get_custom_fields.go +++ b/pkg/cloudapi/compute/get_custom_fields.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetCustomFieldsRequest struct to get Compute's customFields diff --git a/pkg/cloudapi/compute/get_log.go b/pkg/cloudapi/compute/get_log.go index 3e2243c..a08fe32 100644 --- a/pkg/cloudapi/compute/get_log.go +++ b/pkg/cloudapi/compute/get_log.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetLogRequest struct to get compute logs diff --git a/pkg/cloudapi/compute/list.go b/pkg/cloudapi/compute/list.go index fdd231e..1570f53 100644 --- a/pkg/cloudapi/compute/list.go +++ b/pkg/cloudapi/compute/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of available computes diff --git a/pkg/cloudapi/compute/list_deleted.go b/pkg/cloudapi/compute/list_deleted.go index b73cf2a..f785f10 100644 --- a/pkg/cloudapi/compute/list_deleted.go +++ b/pkg/cloudapi/compute/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get deleted computes list diff --git a/pkg/cloudapi/compute/list_pci_device.go b/pkg/cloudapi/compute/list_pci_device.go index 6995999..8c4cd30 100644 --- a/pkg/cloudapi/compute/list_pci_device.go +++ b/pkg/cloudapi/compute/list_pci_device.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListPCIDeviceRequest struct to get list of PCI devices diff --git a/pkg/cloudapi/compute/list_vgpu.go b/pkg/cloudapi/compute/list_vgpu.go index 6914cd3..50002f5 100644 --- a/pkg/cloudapi/compute/list_vgpu.go +++ b/pkg/cloudapi/compute/list_vgpu.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListVGPURequest struct to get vGPU list diff --git a/pkg/cloudapi/compute/models.go b/pkg/cloudapi/compute/models.go index 0037ae7..3aaf0f1 100644 --- a/pkg/cloudapi/compute/models.go +++ b/pkg/cloudapi/compute/models.go @@ -308,6 +308,9 @@ type RecordCompute struct { // Boot order BootOrder []string `json:"bootOrder"` + // Boot type + BootType string `json:"bootType"` + // Boot disk size BootDiskSize uint64 `json:"bootdiskSize"` @@ -368,6 +371,9 @@ type RecordCompute struct { // HPBacked HPBacked bool `json:"hpBacked"` + // Hot resize + HotResize bool `json:"hotResize"` + // ID ID uint64 `json:"id"` @@ -380,6 +386,9 @@ type RecordCompute struct { // List interfaces Interfaces ListInterfaces `json:"interfaces"` + // Loader type + LoaderType string `json:"loaderType"` + // Lock status LockStatus string `json:"lockStatus"` @@ -401,6 +410,9 @@ type RecordCompute struct { // NeedReboot NeedReboot bool `json:"needReboot"` + // Network interface naming + NetworkInterfaceNaming string `json:"networkInterfaceNaming"` + // Numa Affinity NumaAffinity string `json:"numaAffinity"` @@ -425,8 +437,8 @@ type RecordCompute struct { // List OS Users OSUsers ListOSUser `json:"osUsers"` - // Pinned or not - Pinned bool `json:"pinned"` + // Pinned to stack + PinnedToStack bool `json:"pinnedToStack"` // PreferredCPU PreferredCPU []int64 `json:"preferredCpu"` @@ -482,8 +494,8 @@ type RecordCompute struct { // Userdata Userdata interface{} `json:"userdata"` - // vGPU IDs - VGPUs []uint64 `json:"vgpus"` + // vGPUs list + VGPUs []VGPUItem `json:"vgpus"` // Virtual image ID VirtualImageID uint64 `json:"virtualImageId"` @@ -495,6 +507,65 @@ type RecordCompute struct { VNCPassword string `json:"vncPasswd"` } +type VGPUItem struct { + // ID + ID uint64 `json:"id"` + + // GID + GID uint64 `json:"gid"` + + // Type + Type string `json:"type"` + + // Mode + Mode string `json:"mode"` + + // Status + Status string `json:"status"` + + // ProfileID + ProfileID uint64 `json:"profileId"` + + // RAM + RAM uint64 `json:"ram"` + + // LastUpdateTime + LastUpdateTime uint64 `json:"lastUpdateTime"` + + // CreatedTime + CreatedTime uint64 `json:"createdTime"` + + // DeletedTime + DeletedTime uint64 `json:"deletedTime"` + + // VMID + VMID uint64 `json:"vmid"` + + // PGPuid + PGPuid uint64 `json:"pgpuid"` + + // ReferenceID + ReferenceID string `json:"referenceId"` + + // AccountID + AccountID uint64 `json:"accountId"` + + // RgID + RgID uint64 `json:"rgId"` + + // LastClaimedBy + LastClaimedBy uint64 `json:"lastClaimedBy"` + + // PCISlot + PCISlot uint64 `json:"pciSlot"` + + // BusNumber + BusNumber uint64 `json:"bus_number"` + + // GUID + GUID uint64 `json:"guid"` +} + // Information about libvirt settings type LibvirtSettings struct { // TX mode @@ -712,13 +783,13 @@ type ItemComputeDisk struct { Passwd string `json:"passwd"` // PCI slot - PCISlot int64 `json:"pciSlot"` + PCISlot int64 `json:"pci_slot"` // Pool Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Purge time PurgeTime uint64 `json:"purgeTime"` @@ -741,6 +812,9 @@ type ItemComputeDisk struct { // Shareable Shareable bool `json:"shareable"` + // Size available + SizeAvailable float64 `json:"sizeAvailable"` + // Size max SizeMax uint64 `json:"sizeMax"` @@ -759,6 +833,9 @@ type ItemComputeDisk struct { // Type Type string `json:"type"` + // Updated by + UpdatedBy string `json:"updatedBy"` + // Virtual machine ID VMID uint64 `json:"vmid"` } @@ -884,6 +961,9 @@ type ItemCompute struct { // Boot order BootOrder []string `json:"bootOrder"` + // Boot type + BootType string `json:"bootType"` + // Boot disk size BootDiskSize uint64 `json:"bootdiskSize"` @@ -941,6 +1021,9 @@ type ItemCompute struct { // GUID GUID uint64 `json:"guid"` + // Hot resize + HotResize bool `json:"hotResize"` + // HPBacked HPBacked bool `json:"hpBacked"` @@ -953,6 +1036,9 @@ type ItemCompute struct { // List interfaces Interfaces ListInterfaces `json:"interfaces"` + // Loader type + LoaderType string `json:"loaderType"` + // Lock status LockStatus string `json:"lockStatus"` @@ -974,14 +1060,17 @@ type ItemCompute struct { // NeedReboot NeedReboot bool `json:"needReboot"` + // network interface naming + NetworkInterfaceNaming string `json:"networkInterfaceNaming"` + // Numa Affinity NumaAffinity string `json:"numaAffinity"` //NumaNodeId NumaNodeId int64 `json:"numaNodeId"` - // Pinned or not - Pinned bool `json:"pinned"` + // Pinned to stack + PinnedToStack bool `json:"pinnedToStack"` // PreferredCPU PreferredCPU []int64 `json:"preferredCpu"` @@ -1054,12 +1143,6 @@ type ListInfoDisks []InfoDisk type InfoDisk struct { // ID ID uint64 `json:"id"` - - // PCISlot - PCISlot int64 `json:"pciSlot"` - - // Bus number - BusNumber uint64 `json:"bus_number"` } // List information about computes diff --git a/pkg/cloudapi/compute/move_to_rg.go b/pkg/cloudapi/compute/move_to_rg.go index aa4c39e..8f1798c 100644 --- a/pkg/cloudapi/compute/move_to_rg.go +++ b/pkg/cloudapi/compute/move_to_rg.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MoveToRGRequest struct to move compute to new resource group diff --git a/pkg/cloudapi/compute/net_attach.go b/pkg/cloudapi/compute/net_attach.go index 15704c4..9d35147 100644 --- a/pkg/cloudapi/compute/net_attach.go +++ b/pkg/cloudapi/compute/net_attach.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NetAttachRequest struct to attach network @@ -32,6 +32,10 @@ type NetAttachRequest struct { // Required: false IPAddr string `url:"ipAddr,omitempty" json:"ipAddr,omitempty"` + // MAC address + // Required: false + MACAddr string `url:"mac_addr,omitempty" json:"mac_addr,omitempty"` + // Used only for DPDK type, must be 1-9216 // Required: false MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"` diff --git a/pkg/cloudapi/compute/net_detach.go b/pkg/cloudapi/compute/net_detach.go index 99a2611..654f0fc 100644 --- a/pkg/cloudapi/compute/net_detach.go +++ b/pkg/cloudapi/compute/net_detach.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NetDetachRequest struct to detach network from compute diff --git a/pkg/cloudapi/compute/pause.go b/pkg/cloudapi/compute/pause.go index 795145a..53b77d1 100644 --- a/pkg/cloudapi/compute/pause.go +++ b/pkg/cloudapi/compute/pause.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PauseRequest struct to pause compute diff --git a/pkg/cloudapi/compute/pfw_add.go b/pkg/cloudapi/compute/pfw_add.go index f5280fc..65f3bea 100644 --- a/pkg/cloudapi/compute/pfw_add.go +++ b/pkg/cloudapi/compute/pfw_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PFWAddRequest struct to add port forward rule diff --git a/pkg/cloudapi/compute/pfw_del.go b/pkg/cloudapi/compute/pfw_del.go index 6c60179..694f77f 100644 --- a/pkg/cloudapi/compute/pfw_del.go +++ b/pkg/cloudapi/compute/pfw_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PFWDelRequest struct to delete port forward rule diff --git a/pkg/cloudapi/compute/pfw_list.go b/pkg/cloudapi/compute/pfw_list.go index 4dd91e2..2360e85 100644 --- a/pkg/cloudapi/compute/pfw_list.go +++ b/pkg/cloudapi/compute/pfw_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PFWListRequest struct to get list of port forwards diff --git a/pkg/cloudapi/compute/pin_to_stack.go b/pkg/cloudapi/compute/pin_to_stack.go index 5fda488..ffe5e2a 100644 --- a/pkg/cloudapi/compute/pin_to_stack.go +++ b/pkg/cloudapi/compute/pin_to_stack.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PinToStackRequest struct to pin compute to stack diff --git a/pkg/cloudapi/compute/power_cycle.go b/pkg/cloudapi/compute/power_cycle.go index 4cb9d61..681f46e 100644 --- a/pkg/cloudapi/compute/power_cycle.go +++ b/pkg/cloudapi/compute/power_cycle.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PowerCycleRequest struct to force stop and start compute diff --git a/pkg/cloudapi/compute/reboot.go b/pkg/cloudapi/compute/reboot.go index 71c2e8d..20dc4b5 100644 --- a/pkg/cloudapi/compute/reboot.go +++ b/pkg/cloudapi/compute/reboot.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RebootRequest struct to reboot compute diff --git a/pkg/cloudapi/compute/redeploy.go b/pkg/cloudapi/compute/redeploy.go index 28dcc8e..8e45ae8 100644 --- a/pkg/cloudapi/compute/redeploy.go +++ b/pkg/cloudapi/compute/redeploy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RedeployRequest struct to redeploy diff --git a/pkg/cloudapi/compute/reset.go b/pkg/cloudapi/compute/reset.go index 7cfff2b..4c11ba1 100644 --- a/pkg/cloudapi/compute/reset.go +++ b/pkg/cloudapi/compute/reset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResetRequest struct to reset compute diff --git a/pkg/cloudapi/compute/resize.go b/pkg/cloudapi/compute/resize.go index 7218460..a0e2081 100644 --- a/pkg/cloudapi/compute/resize.go +++ b/pkg/cloudapi/compute/resize.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResizeRequest struct to resize compute diff --git a/pkg/cloudapi/compute/restore.go b/pkg/cloudapi/compute/restore.go index 270eb34..f1dcc12 100644 --- a/pkg/cloudapi/compute/restore.go +++ b/pkg/cloudapi/compute/restore.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore compute diff --git a/pkg/cloudapi/compute/resume.go b/pkg/cloudapi/compute/resume.go index 00b14e8..5ef8bcc 100644 --- a/pkg/cloudapi/compute/resume.go +++ b/pkg/cloudapi/compute/resume.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResumeRequest struct to resume compute diff --git a/pkg/cloudapi/compute/serialize.go b/pkg/cloudapi/compute/serialize.go index 95d4963..cf70777 100644 --- a/pkg/cloudapi/compute/serialize.go +++ b/pkg/cloudapi/compute/serialize.go @@ -3,7 +3,7 @@ package compute import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/compute/set_custom_fields.go b/pkg/cloudapi/compute/set_custom_fields.go index fc11f8d..e81177f 100644 --- a/pkg/cloudapi/compute/set_custom_fields.go +++ b/pkg/cloudapi/compute/set_custom_fields.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCustomFieldsRequest struct to set customFields values for the Compute diff --git a/pkg/cloudapi/compute/snapshot_create.go b/pkg/cloudapi/compute/snapshot_create.go index 286844f..51dcc47 100644 --- a/pkg/cloudapi/compute/snapshot_create.go +++ b/pkg/cloudapi/compute/snapshot_create.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotCreateRequest struct to create snapshot diff --git a/pkg/cloudapi/compute/snapshot_delete.go b/pkg/cloudapi/compute/snapshot_delete.go index e6e0cc4..b8d5155 100644 --- a/pkg/cloudapi/compute/snapshot_delete.go +++ b/pkg/cloudapi/compute/snapshot_delete.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotDeleteRequest struct to delete snapshot diff --git a/pkg/cloudapi/compute/snapshot_list.go b/pkg/cloudapi/compute/snapshot_list.go index ee43548..d719cd8 100644 --- a/pkg/cloudapi/compute/snapshot_list.go +++ b/pkg/cloudapi/compute/snapshot_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotListRequest struct to get list snapshots diff --git a/pkg/cloudapi/compute/snapshot_rollback.go b/pkg/cloudapi/compute/snapshot_rollback.go index 21eabd9..ca7e076 100644 --- a/pkg/cloudapi/compute/snapshot_rollback.go +++ b/pkg/cloudapi/compute/snapshot_rollback.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotRollbackRequest struct for rollback diff --git a/pkg/cloudapi/compute/snapshot_usage.go b/pkg/cloudapi/compute/snapshot_usage.go index 4b507a7..c30ab65 100644 --- a/pkg/cloudapi/compute/snapshot_usage.go +++ b/pkg/cloudapi/compute/snapshot_usage.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotUsageRequest struct to get compute snapshot real size on storage diff --git a/pkg/cloudapi/compute/start.go b/pkg/cloudapi/compute/start.go index 50ce8d8..00fb2b4 100644 --- a/pkg/cloudapi/compute/start.go +++ b/pkg/cloudapi/compute/start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StartRequest struct to start compute diff --git a/pkg/cloudapi/compute/stop.go b/pkg/cloudapi/compute/stop.go index 5f86f52..b588f79 100644 --- a/pkg/cloudapi/compute/stop.go +++ b/pkg/cloudapi/compute/stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StopRequest struct to stop compute diff --git a/pkg/cloudapi/compute/tag_add.go b/pkg/cloudapi/compute/tag_add.go index 74b1bd2..70b6c01 100644 --- a/pkg/cloudapi/compute/tag_add.go +++ b/pkg/cloudapi/compute/tag_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // TagAddRequest struct to add tag to compute diff --git a/pkg/cloudapi/compute/tag_remove.go b/pkg/cloudapi/compute/tag_remove.go index b70c6fc..5c44150 100644 --- a/pkg/cloudapi/compute/tag_remove.go +++ b/pkg/cloudapi/compute/tag_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // TagRemoveRequest struct to remove tag from compute diff --git a/pkg/cloudapi/compute/unpin_from_stack.go b/pkg/cloudapi/compute/unpin_from_stack.go index a75aa09..95a05a0 100644 --- a/pkg/cloudapi/compute/unpin_from_stack.go +++ b/pkg/cloudapi/compute/unpin_from_stack.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UnpinFromStackRequest struct for unpin from stack diff --git a/pkg/cloudapi/compute/update.go b/pkg/cloudapi/compute/update.go index 1d876d0..3145aed 100644 --- a/pkg/cloudapi/compute/update.go +++ b/pkg/cloudapi/compute/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update compute @@ -30,28 +30,41 @@ type UpdateRequest struct { // Default: none NumaAffinity string `url:"numaAffinity,omitempty" json:"numaAffinity,omitempty" validate:"omitempty,numaAffinity"` - // Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node + // Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node, true or false // Required: false - // Default: false - CPUPin bool `url:"cpupin" json:"cpupin"` + CPUPin interface{} `url:"cpupin,omitempty" json:"cpupin,omitempty" validate:"omitempty,isBool"` // Type of the emulated system, Q35 or i440fx // Required: false Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"` - // Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node + // Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node, true or false // Required: false - // Default: false - HPBacked bool `url:"hpBacked" json:"hpBacked"` + HPBacked interface{} `url:"hpBacked,omitempty" json:"hpBacked,omitempty" validate:"omitempty,isBool"` - // Auto start when node restarted + // Auto start when node restarted, true or false // Required: false - // Default: false - AutoStart bool `url:"autoStart" json:"autoStart"` + AutoStart interface{} `url:"autoStart,omitempty" json:"autoStart,omitempty" validate:"omitempty,isBool"` // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False // Required: false PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"` + + // VM type linux, windows or unknown + // Required: false + LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"` + + // Boot type of image bios or uefi + // Required: false + BootType string `url:"bootType,omitempty" json:"bootType,omitempty" validate:"omitempty,imageBootType"` + + // Select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming. + // Required: false + NetworkInterfaceNaming string `url:"networkInterfaceNaming,omitempty" json:"networkInterfaceNaming,omitempty" validate:"omitempty,networkInterfaceNaming"` + + // Does this machine supports hot resize, true or false + // Required: false + HotResize interface{} `url:"hotResize,omitempty" json:"hotResize,omitempty" validate:"omitempty,isBool"` } // Update updates some properties of the compute diff --git a/pkg/cloudapi/compute/user_grant.go b/pkg/cloudapi/compute/user_grant.go index f7503f6..92d206e 100644 --- a/pkg/cloudapi/compute/user_grant.go +++ b/pkg/cloudapi/compute/user_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserGrantRequest struct to grant access to compute diff --git a/pkg/cloudapi/compute/user_list.go b/pkg/cloudapi/compute/user_list.go index 0a7eaf4..892276d 100644 --- a/pkg/cloudapi/compute/user_list.go +++ b/pkg/cloudapi/compute/user_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserListRequest struct to get list of users for compute diff --git a/pkg/cloudapi/compute/user_revoke.go b/pkg/cloudapi/compute/user_revoke.go index 1bd569d..8cf2dff 100644 --- a/pkg/cloudapi/compute/user_revoke.go +++ b/pkg/cloudapi/compute/user_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserRevokeRequest struct to revoke user access diff --git a/pkg/cloudapi/compute/user_update.go b/pkg/cloudapi/compute/user_update.go index e0de0be..f996430 100644 --- a/pkg/cloudapi/compute/user_update.go +++ b/pkg/cloudapi/compute/user_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserUpdateRequest struct to update user access diff --git a/pkg/cloudapi/disks.go b/pkg/cloudapi/disks.go index 27f08a3..6cdf0a9 100644 --- a/pkg/cloudapi/disks.go +++ b/pkg/cloudapi/disks.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/disks" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/disks" ) // Accessing the Disks method group diff --git a/pkg/cloudapi/disks/create.go b/pkg/cloudapi/disks/create.go index a03c1e5..1286eee 100644 --- a/pkg/cloudapi/disks/create.go +++ b/pkg/cloudapi/disks/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create disk @@ -14,10 +14,6 @@ type CreateRequest struct { // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` - // ID of the grid (platform) - // Required: true - GID uint64 `url:"gid" json:"gid" validate:"required"` - // Name of disk // Required: true Name string `url:"name" json:"name" validate:"required"` @@ -30,17 +26,6 @@ type CreateRequest struct { // Required: false Size uint64 `url:"size,omitempty" json:"size,omitempty"` - // Type of disk - // - B=Boot - // - D=Data - // - T=Temp - // Required: true - Type string `url:"type" json:"type" validate:"diskType"` - - // Size in GB default is 0 - // Required: false - SSDSize uint64 `url:"ssdSize,omitempty" json:"ssdSize,omitempty"` - // Max IOPS disk can perform defaults to 2000 // Required: false IOPS uint64 `url:"iops,omitempty" json:"iops,omitempty"` diff --git a/pkg/cloudapi/disks/delete.go b/pkg/cloudapi/disks/delete.go index 6064186..ed824dd 100644 --- a/pkg/cloudapi/disks/delete.go +++ b/pkg/cloudapi/disks/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest to delete disk diff --git a/pkg/cloudapi/disks/delete_disks.go b/pkg/cloudapi/disks/delete_disks.go index 444dbcd..2dea7c0 100644 --- a/pkg/cloudapi/disks/delete_disks.go +++ b/pkg/cloudapi/disks/delete_disks.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisksDeleteRequest struct for multiple disks diff --git a/pkg/cloudapi/disks/disks.go b/pkg/cloudapi/disks/disks.go index d49870e..f792a77 100644 --- a/pkg/cloudapi/disks/disks.go +++ b/pkg/cloudapi/disks/disks.go @@ -2,7 +2,7 @@ package disks import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to disks diff --git a/pkg/cloudapi/disks/filter.go b/pkg/cloudapi/disks/filter.go index 219f0f2..841e251 100644 --- a/pkg/cloudapi/disks/filter.go +++ b/pkg/cloudapi/disks/filter.go @@ -4,9 +4,9 @@ import ( "context" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/k8s" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/lb" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/lb" ) // FilterByID returns ListDisks with specified ID. diff --git a/pkg/cloudapi/disks/filter_test.go b/pkg/cloudapi/disks/filter_test.go index 8b72929..9e46355 100644 --- a/pkg/cloudapi/disks/filter_test.go +++ b/pkg/cloudapi/disks/filter_test.go @@ -35,9 +35,9 @@ var disks = ListDisks{ ParentID: 0, PCISlot: 6, Pool: "vmstor", - PresentTo: []uint64{ - 27, - }, + //PresentTo: []uint64{ + // 27, + //}, PurgeTime: 0, ResID: "sample", ResName: "sample", @@ -78,10 +78,10 @@ var disks = ListDisks{ ParentID: 0, PCISlot: 6, Pool: "vmstor", - PresentTo: []uint64{ - 27, - 27, - }, + //PresentTo: []uint64{ + // 27, + // 27, + //}, PurgeTime: 0, ResID: "sample", ResName: "sample", @@ -211,9 +211,9 @@ var searchDisks = ListSearchDisks{ ParentID: 0, PCISlot: 6, Pool: "vmstor", - PresentTo: []uint64{ - 27, - }, + //PresentTo: []uint64{ + // 27, + //}, PurgeTime: 0, ResID: "sample", ResName: "sample", @@ -254,10 +254,10 @@ var searchDisks = ListSearchDisks{ ParentID: 0, PCISlot: 6, Pool: "vmstor", - PresentTo: []uint64{ - 27, - 27, - }, + //PresentTo: []uint64{ + // 27, + // 27, + //}, PurgeTime: 0, ResID: "sample", ResName: "sample", @@ -393,7 +393,7 @@ var unattachedDisks = ListDisksUnattached{ Password: "", PCISlot: -1, Pool: "data05", - PresentTo: []uint64{}, + PresentTo: map[string]uint64{}, PurgeAttempts: 0, PurgeTime: 0, RealityDeviceNumber: 0, @@ -445,10 +445,10 @@ var unattachedDisks = ListDisksUnattached{ Password: "", PCISlot: -1, Pool: "data05", - PresentTo: []uint64{ - 27, - 27, - }, + //PresentTo: []uint64{ + // 27, + // 27, + //}, PurgeAttempts: 0, PurgeTime: 0, RealityDeviceNumber: 0, diff --git a/pkg/cloudapi/disks/from_platform_disk.go b/pkg/cloudapi/disks/from_platform_disk.go index 9d879f6..25c9271 100644 --- a/pkg/cloudapi/disks/from_platform_disk.go +++ b/pkg/cloudapi/disks/from_platform_disk.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FromPlatformDiskRequest struct to create template from platform disk @@ -45,10 +45,6 @@ type FromPlatformDiskRequest struct { // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` - // SEP ID - // Required: false - SepID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"` - // Pool for image create // Required: false PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"` diff --git a/pkg/cloudapi/disks/get.go b/pkg/cloudapi/disks/get.go index 756b6e1..68a8ae1 100644 --- a/pkg/cloudapi/disks/get.go +++ b/pkg/cloudapi/disks/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about disk diff --git a/pkg/cloudapi/disks/limitio.go b/pkg/cloudapi/disks/limitio.go index b358b3e..2177819 100644 --- a/pkg/cloudapi/disks/limitio.go +++ b/pkg/cloudapi/disks/limitio.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // LimitIORequest struct for limit IO diff --git a/pkg/cloudapi/disks/list.go b/pkg/cloudapi/disks/list.go index 89e9caf..9549fd7 100644 --- a/pkg/cloudapi/disks/list.go +++ b/pkg/cloudapi/disks/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of disks diff --git a/pkg/cloudapi/disks/list_deleted.go b/pkg/cloudapi/disks/list_deleted.go index e49ea7a..0da1623 100644 --- a/pkg/cloudapi/disks/list_deleted.go +++ b/pkg/cloudapi/disks/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted disks diff --git a/pkg/cloudapi/disks/list_types.go b/pkg/cloudapi/disks/list_types.go index 84d451e..39f6e28 100644 --- a/pkg/cloudapi/disks/list_types.go +++ b/pkg/cloudapi/disks/list_types.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListTypesRequest struct to get list types of disks diff --git a/pkg/cloudapi/disks/list_unattached.go b/pkg/cloudapi/disks/list_unattached.go index 610dbff..9a5de6f 100644 --- a/pkg/cloudapi/disks/list_unattached.go +++ b/pkg/cloudapi/disks/list_unattached.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListUnattachedRequest struct to get list of unattached disk diff --git a/pkg/cloudapi/disks/models.go b/pkg/cloudapi/disks/models.go index 2838b65..026b78e 100644 --- a/pkg/cloudapi/disks/models.go +++ b/pkg/cloudapi/disks/models.go @@ -14,9 +14,15 @@ type ItemDisk struct { // Computes Computes map[string]string `json:"computes"` + //Created by + CreatedBy string `json:"createdBy"` + // Created time CreatedTime uint64 `json:"createdTime"` + // Deleted by + DeletedBy string `json:"deletedBy"` + // Deleted time DeletedTime uint64 `json:"deletedTime"` @@ -50,6 +56,9 @@ type ItemDisk struct { // Machine name MachineName string `json:"machineName"` + // Milestones + Milestones uint64 `json:"milestones"` + // Name Name string `json:"name"` @@ -69,7 +78,7 @@ type ItemDisk struct { Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Purge time PurgeTime uint64 `json:"purgeTime"` @@ -95,6 +104,9 @@ type ItemDisk struct { // SepID SepID uint64 `json:"sepId"` + // Size available + SizeAvailable float64 `json:"sizeAvailable"` + // Size max SizeMax uint64 `json:"sizeMax"` @@ -115,6 +127,12 @@ type ItemDisk struct { // Virtual machine ID VMID uint64 `json:"vmid"` + + // Update time + UpdatedTime uint64 `json:"updatedTime"` + + // Updated by + UpdatedBy string `json:"updatedBy"` } type ItemDiskUnattached struct { @@ -200,7 +218,7 @@ type ItemDiskUnattached struct { Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Purge attempts PurgeAttempts uint64 `json:"purgeAttempts"` @@ -354,9 +372,15 @@ type RecordDisk struct { // Computes Computes map[string]string `json:"computes"` + // Created by + CreatedBy string `json:"createdBy"` + // Created time CreatedTime uint64 `json:"createdTime"` + // Deleted by + DeletedBy string `json:"deletedBy"` + // Deleted time DeletedTime uint64 `json:"deletedTime"` @@ -384,6 +408,15 @@ type RecordDisk struct { // IOTune IOTune IOTune `json:"iotune"` + // Machine ID + MachineID uint64 `json:"machineId"` + + // Machine name + MachineName string `json:"machineName"` + + // Milestones + Milestones uint64 `json:"milestones"` + // Name Name string `json:"name"` @@ -403,7 +436,7 @@ type RecordDisk struct { Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Purge time PurgeTime uint64 `json:"purgeTime"` @@ -429,6 +462,9 @@ type RecordDisk struct { // Shareable Shareable bool `json:"shareable"` + // Size available + SizeAvailable float64 `json:"sizeAvailable"` + // Size max SizeMax uint64 `json:"sizeMax"` @@ -449,6 +485,12 @@ type RecordDisk struct { // Virtual machine ID VMID uint64 `json:"vmid"` + + // Update time + UpdatedTime uint64 `json:"updatedTime"` + + // Updated by + UpdatedBy string `json:"updatedBy"` } type ItemReplication struct { diff --git a/pkg/cloudapi/disks/rename.go b/pkg/cloudapi/disks/rename.go index 8777715..8956e8e 100644 --- a/pkg/cloudapi/disks/rename.go +++ b/pkg/cloudapi/disks/rename.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RenameRequest struct to rename disk diff --git a/pkg/cloudapi/disks/replicate.go b/pkg/cloudapi/disks/replicate.go index 103502c..557699e 100644 --- a/pkg/cloudapi/disks/replicate.go +++ b/pkg/cloudapi/disks/replicate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicateRequest struct to create an empty disk in chosen SEP and pool combination. diff --git a/pkg/cloudapi/disks/replication_resume.go b/pkg/cloudapi/disks/replication_resume.go index b1ac504..19a8791 100644 --- a/pkg/cloudapi/disks/replication_resume.go +++ b/pkg/cloudapi/disks/replication_resume.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationResume struct to resume suspended replication diff --git a/pkg/cloudapi/disks/replication_reverse.go b/pkg/cloudapi/disks/replication_reverse.go index 5f458ef..454513e 100644 --- a/pkg/cloudapi/disks/replication_reverse.go +++ b/pkg/cloudapi/disks/replication_reverse.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationReverseRequest struct to change role between disks replications diff --git a/pkg/cloudapi/disks/replication_start.go b/pkg/cloudapi/disks/replication_start.go index c344cd5..1dd241d 100644 --- a/pkg/cloudapi/disks/replication_start.go +++ b/pkg/cloudapi/disks/replication_start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationStartRequest struct to starts replication between two chosen disks diff --git a/pkg/cloudapi/disks/replication_status.go b/pkg/cloudapi/disks/replication_status.go index 3d729f5..e0a42e3 100644 --- a/pkg/cloudapi/disks/replication_status.go +++ b/pkg/cloudapi/disks/replication_status.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationStatusRequest struct to get replication status diff --git a/pkg/cloudapi/disks/replication_stop.go b/pkg/cloudapi/disks/replication_stop.go index 21fd37c..693763e 100644 --- a/pkg/cloudapi/disks/replication_stop.go +++ b/pkg/cloudapi/disks/replication_stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationStopRequest struct to remove replication between disks completely diff --git a/pkg/cloudapi/disks/replication_suspend.go b/pkg/cloudapi/disks/replication_suspend.go index 2dbfc00..1e705d7 100644 --- a/pkg/cloudapi/disks/replication_suspend.go +++ b/pkg/cloudapi/disks/replication_suspend.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationSuspendRequest struct to pause replication with possibility to resume from pause moment diff --git a/pkg/cloudapi/disks/resize.go b/pkg/cloudapi/disks/resize.go index 43d1bc5..13381d3 100644 --- a/pkg/cloudapi/disks/resize.go +++ b/pkg/cloudapi/disks/resize.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResizeRequest struct to resize disk diff --git a/pkg/cloudapi/disks/restore.go b/pkg/cloudapi/disks/restore.go index 2581366..fcacebd 100644 --- a/pkg/cloudapi/disks/restore.go +++ b/pkg/cloudapi/disks/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore a deleted unattached disk diff --git a/pkg/cloudapi/disks/serialize.go b/pkg/cloudapi/disks/serialize.go index 0ffe92c..fb763e8 100644 --- a/pkg/cloudapi/disks/serialize.go +++ b/pkg/cloudapi/disks/serialize.go @@ -3,7 +3,7 @@ package disks import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/disks/share.go b/pkg/cloudapi/disks/share.go index 06d1cd1..5bf0207 100644 --- a/pkg/cloudapi/disks/share.go +++ b/pkg/cloudapi/disks/share.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ShareRequest struct to share disk data diff --git a/pkg/cloudapi/disks/snapshot_delete.go b/pkg/cloudapi/disks/snapshot_delete.go index dd95f02..81c6f9b 100644 --- a/pkg/cloudapi/disks/snapshot_delete.go +++ b/pkg/cloudapi/disks/snapshot_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotDeleteRequest struct to delete snapshot diff --git a/pkg/cloudapi/disks/snapshot_rollback.go b/pkg/cloudapi/disks/snapshot_rollback.go index 022229e..21de92b 100644 --- a/pkg/cloudapi/disks/snapshot_rollback.go +++ b/pkg/cloudapi/disks/snapshot_rollback.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotRollbackRequest struct to rollback snapshot diff --git a/pkg/cloudapi/disks/unshare.go b/pkg/cloudapi/disks/unshare.go index e081873..ca3f906 100644 --- a/pkg/cloudapi/disks/unshare.go +++ b/pkg/cloudapi/disks/unshare.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UnshareRequest struct to unshare data disk diff --git a/pkg/cloudapi/dpdknet.go b/pkg/cloudapi/dpdknet.go index e977d4a..29d3194 100644 --- a/pkg/cloudapi/dpdknet.go +++ b/pkg/cloudapi/dpdknet.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/dpdknet" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/dpdknet" // Accessing the DPDKNet method group func (ca *CloudAPI) DPDKNet() *dpdknet.DPDKNet { diff --git a/pkg/cloudapi/dpdknet/dpdknet.go b/pkg/cloudapi/dpdknet/dpdknet.go index 8b301fa..0d2500f 100644 --- a/pkg/cloudapi/dpdknet/dpdknet.go +++ b/pkg/cloudapi/dpdknet/dpdknet.go @@ -1,6 +1,6 @@ package dpdknet -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to DPDK network type DPDKNet struct { diff --git a/pkg/cloudapi/dpdknet/get.go b/pkg/cloudapi/dpdknet/get.go index 8ec8cd1..9187e48 100644 --- a/pkg/cloudapi/dpdknet/get.go +++ b/pkg/cloudapi/dpdknet/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about DPDK network diff --git a/pkg/cloudapi/dpdknet/list.go b/pkg/cloudapi/dpdknet/list.go index 873277c..e7053dc 100644 --- a/pkg/cloudapi/dpdknet/list.go +++ b/pkg/cloudapi/dpdknet/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of DPDK networks diff --git a/pkg/cloudapi/extnet.go b/pkg/cloudapi/extnet.go index 883d9e3..8dff27f 100644 --- a/pkg/cloudapi/extnet.go +++ b/pkg/cloudapi/extnet.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/extnet" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/extnet" ) // Accessing the ExtNet method group diff --git a/pkg/cloudapi/extnet/extnet.go b/pkg/cloudapi/extnet/extnet.go index 9263a7e..6f972b8 100644 --- a/pkg/cloudapi/extnet/extnet.go +++ b/pkg/cloudapi/extnet/extnet.go @@ -2,7 +2,7 @@ package extnet import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to extnet diff --git a/pkg/cloudapi/extnet/get.go b/pkg/cloudapi/extnet/get.go index bab7294..6bfd273 100644 --- a/pkg/cloudapi/extnet/get.go +++ b/pkg/cloudapi/extnet/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about external network diff --git a/pkg/cloudapi/extnet/get_reserved_ip.go b/pkg/cloudapi/extnet/get_reserved_ip.go index cf04003..7485884 100644 --- a/pkg/cloudapi/extnet/get_reserved_ip.go +++ b/pkg/cloudapi/extnet/get_reserved_ip.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about reserved address or address poll diff --git a/pkg/cloudapi/extnet/list.go b/pkg/cloudapi/extnet/list.go index fe4d16d..f30aa9f 100644 --- a/pkg/cloudapi/extnet/list.go +++ b/pkg/cloudapi/extnet/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of external network @@ -49,6 +49,10 @@ type ListRequest struct { // Page size // Required: false Size uint64 `url:"size,omitempty" json:"size,omitempty"` + + //openVswitch bridge name + //Required: false + OVSBridge string `url:"ovsBridge,omitempty" json:"ovsBridge,omitempty"` } // List gets list of all available external networks as a ListExtNets struct diff --git a/pkg/cloudapi/extnet/list_computes.go b/pkg/cloudapi/extnet/list_computes.go index bd00cfc..4a2a8e1 100644 --- a/pkg/cloudapi/extnet/list_computes.go +++ b/pkg/cloudapi/extnet/list_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListComputesRequest struct to get list computes diff --git a/pkg/cloudapi/extnet/models.go b/pkg/cloudapi/extnet/models.go index cb52015..8911f61 100644 --- a/pkg/cloudapi/extnet/models.go +++ b/pkg/cloudapi/extnet/models.go @@ -202,6 +202,9 @@ type RecordExtNet struct { // Network ID NetworkID uint64 `json:"networkId"` + // NTP + NTP []string `json:"ntp"` + // OVS Bridge OVSBridge string `json:"ovsBridge"` diff --git a/pkg/cloudapi/extnet/serialize.go b/pkg/cloudapi/extnet/serialize.go index dcee4b0..d140922 100644 --- a/pkg/cloudapi/extnet/serialize.go +++ b/pkg/cloudapi/extnet/serialize.go @@ -3,7 +3,7 @@ package extnet import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/flipgroup.go b/pkg/cloudapi/flipgroup.go index 1fbab51..9f4be79 100644 --- a/pkg/cloudapi/flipgroup.go +++ b/pkg/cloudapi/flipgroup.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/flipgroup" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/flipgroup" ) // Accessing the FLIPGroup method group diff --git a/pkg/cloudapi/flipgroup/compute_add.go b/pkg/cloudapi/flipgroup/compute_add.go index e9c80a3..7f87623 100644 --- a/pkg/cloudapi/flipgroup/compute_add.go +++ b/pkg/cloudapi/flipgroup/compute_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeAddRequest struct to add compute instance diff --git a/pkg/cloudapi/flipgroup/compute_remove.go b/pkg/cloudapi/flipgroup/compute_remove.go index ac5cbc5..f7f821a 100644 --- a/pkg/cloudapi/flipgroup/compute_remove.go +++ b/pkg/cloudapi/flipgroup/compute_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeRemoveRequest struct to remove compute instance diff --git a/pkg/cloudapi/flipgroup/create.go b/pkg/cloudapi/flipgroup/create.go index 4a398a3..3b8f6dc 100644 --- a/pkg/cloudapi/flipgroup/create.go +++ b/pkg/cloudapi/flipgroup/create.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create FLIPGroup diff --git a/pkg/cloudapi/flipgroup/delete.go b/pkg/cloudapi/flipgroup/delete.go index 755a853..367691e 100644 --- a/pkg/cloudapi/flipgroup/delete.go +++ b/pkg/cloudapi/flipgroup/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete FLIPGroup diff --git a/pkg/cloudapi/flipgroup/edit.go b/pkg/cloudapi/flipgroup/edit.go index a79e9b2..77b8ad2 100644 --- a/pkg/cloudapi/flipgroup/edit.go +++ b/pkg/cloudapi/flipgroup/edit.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EditRequest struct to edit FLIPGroup diff --git a/pkg/cloudapi/flipgroup/flipgroup.go b/pkg/cloudapi/flipgroup/flipgroup.go index 9e75eee..d532897 100644 --- a/pkg/cloudapi/flipgroup/flipgroup.go +++ b/pkg/cloudapi/flipgroup/flipgroup.go @@ -2,7 +2,7 @@ package flipgroup import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to FLIPGroup diff --git a/pkg/cloudapi/flipgroup/get.go b/pkg/cloudapi/flipgroup/get.go index 27551b7..6693f1e 100644 --- a/pkg/cloudapi/flipgroup/get.go +++ b/pkg/cloudapi/flipgroup/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about FLIPGroup diff --git a/pkg/cloudapi/flipgroup/list.go b/pkg/cloudapi/flipgroup/list.go index 2b2a1b5..e7b014a 100644 --- a/pkg/cloudapi/flipgroup/list.go +++ b/pkg/cloudapi/flipgroup/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of FLIPGroup available to the current user diff --git a/pkg/cloudapi/flipgroup/serialize.go b/pkg/cloudapi/flipgroup/serialize.go index 9f367e3..a53fca9 100644 --- a/pkg/cloudapi/flipgroup/serialize.go +++ b/pkg/cloudapi/flipgroup/serialize.go @@ -3,7 +3,7 @@ package flipgroup import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/image.go b/pkg/cloudapi/image.go index 3c6f07b..5676bb9 100644 --- a/pkg/cloudapi/image.go +++ b/pkg/cloudapi/image.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/image" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/image" ) // Accessing the Image method group diff --git a/pkg/cloudapi/image/create.go b/pkg/cloudapi/image/create.go index 139c9dc..b8d2cee 100644 --- a/pkg/cloudapi/image/create.go +++ b/pkg/cloudapi/image/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create image diff --git a/pkg/cloudapi/image/create_virtual.go b/pkg/cloudapi/image/create_virtual.go index f8b84a2..296b1dc 100644 --- a/pkg/cloudapi/image/create_virtual.go +++ b/pkg/cloudapi/image/create_virtual.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateVirtualRequest struct to create virtual image diff --git a/pkg/cloudapi/image/delete.go b/pkg/cloudapi/image/delete.go index 57cd2dc..46ef137 100644 --- a/pkg/cloudapi/image/delete.go +++ b/pkg/cloudapi/image/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete image diff --git a/pkg/cloudapi/image/get.go b/pkg/cloudapi/image/get.go index d267c39..5dd9943 100644 --- a/pkg/cloudapi/image/get.go +++ b/pkg/cloudapi/image/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about image diff --git a/pkg/cloudapi/image/image.go b/pkg/cloudapi/image/image.go index 4c6e9cc..3834a40 100644 --- a/pkg/cloudapi/image/image.go +++ b/pkg/cloudapi/image/image.go @@ -2,7 +2,7 @@ package image import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to image diff --git a/pkg/cloudapi/image/link.go b/pkg/cloudapi/image/link.go index 3e9ec31..afdee33 100644 --- a/pkg/cloudapi/image/link.go +++ b/pkg/cloudapi/image/link.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // LinkRequest struct to link virtual image to another image diff --git a/pkg/cloudapi/image/list.go b/pkg/cloudapi/image/list.go index 7280ac8..90d2576 100644 --- a/pkg/cloudapi/image/list.go +++ b/pkg/cloudapi/image/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of available images diff --git a/pkg/cloudapi/image/models.go b/pkg/cloudapi/image/models.go index b04df24..fe455e2 100644 --- a/pkg/cloudapi/image/models.go +++ b/pkg/cloudapi/image/models.go @@ -162,7 +162,7 @@ type RecordImage struct { Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // ProviderName ProviderName string `json:"provider_name"` @@ -185,6 +185,9 @@ type RecordImage struct { // Size Size uint64 `json:"size"` + // snapshot ID + SnapshotID string `json:"snapshotId"` + // Status Status string `json:"status"` diff --git a/pkg/cloudapi/image/rename.go b/pkg/cloudapi/image/rename.go index 5b1b76e..adbbab6 100644 --- a/pkg/cloudapi/image/rename.go +++ b/pkg/cloudapi/image/rename.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RenameRequest struct to rename image diff --git a/pkg/cloudapi/image/serialize.go b/pkg/cloudapi/image/serialize.go index 689c394..eee9cb7 100644 --- a/pkg/cloudapi/image/serialize.go +++ b/pkg/cloudapi/image/serialize.go @@ -3,7 +3,7 @@ package image import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/k8ci.go b/pkg/cloudapi/k8ci.go index ce4e43c..a76fd72 100644 --- a/pkg/cloudapi/k8ci.go +++ b/pkg/cloudapi/k8ci.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/k8ci" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/k8ci" ) // Accessing the K8CI method group diff --git a/pkg/cloudapi/k8ci/get.go b/pkg/cloudapi/k8ci/get.go index 13c6931..ddd289e 100644 --- a/pkg/cloudapi/k8ci/get.go +++ b/pkg/cloudapi/k8ci/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about K8CI diff --git a/pkg/cloudapi/k8ci/k8ci.go b/pkg/cloudapi/k8ci/k8ci.go index 0142773..bc7542d 100644 --- a/pkg/cloudapi/k8ci/k8ci.go +++ b/pkg/cloudapi/k8ci/k8ci.go @@ -2,7 +2,7 @@ package k8ci import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to K8CI diff --git a/pkg/cloudapi/k8ci/list.go b/pkg/cloudapi/k8ci/list.go index 0272ada..720e64f 100644 --- a/pkg/cloudapi/k8ci/list.go +++ b/pkg/cloudapi/k8ci/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of information about images diff --git a/pkg/cloudapi/k8ci/list_deleted.go b/pkg/cloudapi/k8ci/list_deleted.go index 0ab8c68..47e2fe9 100644 --- a/pkg/cloudapi/k8ci/list_deleted.go +++ b/pkg/cloudapi/k8ci/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list information about deleted k8ci items diff --git a/pkg/cloudapi/k8ci/serialize.go b/pkg/cloudapi/k8ci/serialize.go index e63136d..f5d61be 100644 --- a/pkg/cloudapi/k8ci/serialize.go +++ b/pkg/cloudapi/k8ci/serialize.go @@ -3,7 +3,7 @@ package k8ci import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/k8s.go b/pkg/cloudapi/k8s.go index 29cf952..f848841 100644 --- a/pkg/cloudapi/k8s.go +++ b/pkg/cloudapi/k8s.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/k8s" ) // Accessing the K8S method group diff --git a/pkg/cloudapi/k8s/create.go b/pkg/cloudapi/k8s/create.go index 2605b66..d6f3480 100644 --- a/pkg/cloudapi/k8s/create.go +++ b/pkg/cloudapi/k8s/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create kubernetes cluster diff --git a/pkg/cloudapi/k8s/delete.go b/pkg/cloudapi/k8s/delete.go index 5466444..151efad 100644 --- a/pkg/cloudapi/k8s/delete.go +++ b/pkg/cloudapi/k8s/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete kubernetes cluster diff --git a/pkg/cloudapi/k8s/delete_master_from_group.go b/pkg/cloudapi/k8s/delete_master_from_group.go index 8a1b051..d9378c6 100644 --- a/pkg/cloudapi/k8s/delete_master_from_group.go +++ b/pkg/cloudapi/k8s/delete_master_from_group.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteMasterFromGroupRequest struct to delete master from group diff --git a/pkg/cloudapi/k8s/delete_worker_from_group.go b/pkg/cloudapi/k8s/delete_worker_from_group.go index c217a3e..ffb6b2d 100644 --- a/pkg/cloudapi/k8s/delete_worker_from_group.go +++ b/pkg/cloudapi/k8s/delete_worker_from_group.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteWorkerFromGroupRequest struct to delete worker from group diff --git a/pkg/cloudapi/k8s/disable_enable.go b/pkg/cloudapi/k8s/disable_enable.go index d3e9643..0105049 100644 --- a/pkg/cloudapi/k8s/disable_enable.go +++ b/pkg/cloudapi/k8s/disable_enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableEnableRequest struct to disable/enable kubernetes cluster diff --git a/pkg/cloudapi/k8s/find_group_by_label.go b/pkg/cloudapi/k8s/find_group_by_label.go index ad2b334..c47ad9a 100644 --- a/pkg/cloudapi/k8s/find_group_by_label.go +++ b/pkg/cloudapi/k8s/find_group_by_label.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FindGroupByLabelRequest struct to get information about group of kubernetes cluster diff --git a/pkg/cloudapi/k8s/get.go b/pkg/cloudapi/k8s/get.go index 7e32b8a..0e7a767 100644 --- a/pkg/cloudapi/k8s/get.go +++ b/pkg/cloudapi/k8s/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about kubernetes cluster diff --git a/pkg/cloudapi/k8s/get_config.go b/pkg/cloudapi/k8s/get_config.go index d4421e6..b71848e 100644 --- a/pkg/cloudapi/k8s/get_config.go +++ b/pkg/cloudapi/k8s/get_config.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetConfigRequest struct to get configuration of kubernetes cluster diff --git a/pkg/cloudapi/k8s/get_node_annotations.go b/pkg/cloudapi/k8s/get_node_annotations.go index 0afe0fb..f7034cf 100644 --- a/pkg/cloudapi/k8s/get_node_annotations.go +++ b/pkg/cloudapi/k8s/get_node_annotations.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetNodeAnnotationsRequest struct to get node annotations diff --git a/pkg/cloudapi/k8s/get_node_labels.go b/pkg/cloudapi/k8s/get_node_labels.go index 1a75c90..01e317e 100644 --- a/pkg/cloudapi/k8s/get_node_labels.go +++ b/pkg/cloudapi/k8s/get_node_labels.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetNodeLabelsRequest struct to get node labels diff --git a/pkg/cloudapi/k8s/get_node_taints.go b/pkg/cloudapi/k8s/get_node_taints.go index 18ee1bf..3f3041a 100644 --- a/pkg/cloudapi/k8s/get_node_taints.go +++ b/pkg/cloudapi/k8s/get_node_taints.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetNodeTaintsRequest struct to get node taints diff --git a/pkg/cloudapi/k8s/get_worker_nodes_meta_data.go b/pkg/cloudapi/k8s/get_worker_nodes_meta_data.go index 4db901e..c4c9a01 100644 --- a/pkg/cloudapi/k8s/get_worker_nodes_meta_data.go +++ b/pkg/cloudapi/k8s/get_worker_nodes_meta_data.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetWorkerNodesMetaDataRequest struct to get worker group metadata by ID diff --git a/pkg/cloudapi/k8s/k8s.go b/pkg/cloudapi/k8s/k8s.go index ab1a456..99f53b2 100644 --- a/pkg/cloudapi/k8s/k8s.go +++ b/pkg/cloudapi/k8s/k8s.go @@ -2,7 +2,7 @@ package k8s import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to K8S diff --git a/pkg/cloudapi/k8s/list.go b/pkg/cloudapi/k8s/list.go index 13e0375..7cba8e4 100644 --- a/pkg/cloudapi/k8s/list.go +++ b/pkg/cloudapi/k8s/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list information K8S diff --git a/pkg/cloudapi/k8s/list_deleted.go b/pkg/cloudapi/k8s/list_deleted.go index 7c3f96f..166a1da 100644 --- a/pkg/cloudapi/k8s/list_deleted.go +++ b/pkg/cloudapi/k8s/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted kubernetes cluster diff --git a/pkg/cloudapi/k8s/models.go b/pkg/cloudapi/k8s/models.go index d6df394..d5eb418 100644 --- a/pkg/cloudapi/k8s/models.go +++ b/pkg/cloudapi/k8s/models.go @@ -89,6 +89,9 @@ type RecordK8S struct { // Deleted time DeletedTime uint64 `json:"deletedTime"` + // Description + Description string `json:"desc"` + // Only external network ExtnetOnly bool `json:"extnetOnly"` diff --git a/pkg/cloudapi/k8s/restore.go b/pkg/cloudapi/k8s/restore.go index e07312c..3e5ebd7 100644 --- a/pkg/cloudapi/k8s/restore.go +++ b/pkg/cloudapi/k8s/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore kubernetes cluster diff --git a/pkg/cloudapi/k8s/serialize.go b/pkg/cloudapi/k8s/serialize.go index c2dd456..def5e2e 100644 --- a/pkg/cloudapi/k8s/serialize.go +++ b/pkg/cloudapi/k8s/serialize.go @@ -3,7 +3,7 @@ package k8s import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/k8s/start.go b/pkg/cloudapi/k8s/start.go index e0b20b2..010c326 100644 --- a/pkg/cloudapi/k8s/start.go +++ b/pkg/cloudapi/k8s/start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StartRequest struct to start kubernetes cluster diff --git a/pkg/cloudapi/k8s/stop.go b/pkg/cloudapi/k8s/stop.go index 8f7e31e..69f0c22 100644 --- a/pkg/cloudapi/k8s/stop.go +++ b/pkg/cloudapi/k8s/stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StopRequest struct to stop kubernetes cluster diff --git a/pkg/cloudapi/k8s/update.go b/pkg/cloudapi/k8s/update.go index aeef0e1..16a5115 100644 --- a/pkg/cloudapi/k8s/update.go +++ b/pkg/cloudapi/k8s/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update kubernetes cluster diff --git a/pkg/cloudapi/k8s/update_worker_nodes_meta_data.go b/pkg/cloudapi/k8s/update_worker_nodes_meta_data.go index e4e92e2..d84e7c7 100644 --- a/pkg/cloudapi/k8s/update_worker_nodes_meta_data.go +++ b/pkg/cloudapi/k8s/update_worker_nodes_meta_data.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateWorkerNodesMetaDataRequest struct to add worker to a kubernetes cluster diff --git a/pkg/cloudapi/k8s/worker_add.go b/pkg/cloudapi/k8s/worker_add.go index dac5b1f..72abd27 100644 --- a/pkg/cloudapi/k8s/worker_add.go +++ b/pkg/cloudapi/k8s/worker_add.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkerAddRequest struct to add worker to a kubernetes cluster diff --git a/pkg/cloudapi/k8s/worker_reset.go b/pkg/cloudapi/k8s/worker_reset.go index 6ef6c05..5c277f3 100644 --- a/pkg/cloudapi/k8s/worker_reset.go +++ b/pkg/cloudapi/k8s/worker_reset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkerResetRequest struct for hard reset kubernetes cluster diff --git a/pkg/cloudapi/k8s/worker_restart.go b/pkg/cloudapi/k8s/worker_restart.go index f6527d8..17caacb 100644 --- a/pkg/cloudapi/k8s/worker_restart.go +++ b/pkg/cloudapi/k8s/worker_restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkerRestartRequest struct to restart worker node diff --git a/pkg/cloudapi/k8s/workers_group_add.go b/pkg/cloudapi/k8s/workers_group_add.go index 843775a..0fa9459 100644 --- a/pkg/cloudapi/k8s/workers_group_add.go +++ b/pkg/cloudapi/k8s/workers_group_add.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkersGroupAddRequest struct to add workers group diff --git a/pkg/cloudapi/k8s/workers_group_delete.go b/pkg/cloudapi/k8s/workers_group_delete.go index b411338..649538f 100644 --- a/pkg/cloudapi/k8s/workers_group_delete.go +++ b/pkg/cloudapi/k8s/workers_group_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkersGroupDeleteRequest struct to delete workers group diff --git a/pkg/cloudapi/k8s/workers_group_get_by_name.go b/pkg/cloudapi/k8s/workers_group_get_by_name.go index 029d72c..296f2bd 100644 --- a/pkg/cloudapi/k8s/workers_group_get_by_name.go +++ b/pkg/cloudapi/k8s/workers_group_get_by_name.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkersGroupGetByNameRequest struct to get information about worker group diff --git a/pkg/cloudapi/kvmx86.go b/pkg/cloudapi/kvmx86.go index 25329df..2ac802e 100644 --- a/pkg/cloudapi/kvmx86.go +++ b/pkg/cloudapi/kvmx86.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/kvmx86" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/kvmx86" ) // Accessing the KVMX86 method group diff --git a/pkg/cloudapi/kvmx86/create.go b/pkg/cloudapi/kvmx86/create.go index 8ed5a57..17e1e52 100644 --- a/pkg/cloudapi/kvmx86/create.go +++ b/pkg/cloudapi/kvmx86/create.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type Interface struct { @@ -31,6 +31,10 @@ type Interface struct { // Used only to DPDK net type // Required: false MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"` + + // MAC address to assign to this VM when connecting to the specified network + // Required: false + MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"` } // DataDisk detailed struct for DataDisks field in CreateRequest and CreateBlankRequest diff --git a/pkg/cloudapi/kvmx86/create_blank.go b/pkg/cloudapi/kvmx86/create_blank.go index 09dad2b..9490e45 100644 --- a/pkg/cloudapi/kvmx86/create_blank.go +++ b/pkg/cloudapi/kvmx86/create_blank.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateBlankRequest struct to create KVM x86 VM from scratch @@ -72,6 +72,22 @@ type CreateBlankRequest struct { // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False // Required: false PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"` + + // VM type linux, windows or unknown + // Required: false + LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"` + + // Boot type of image bios or uefi + // Required: false + BootType string `url:"bootType,omitempty" json:"bootType,omitempty" validate:"omitempty,imageBootType"` + + // Select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming. + // Required: false + NetworkInterfaceNaming string `url:"networkInterfaceNaming,omitempty" json:"networkInterfaceNaming,omitempty" validate:"omitempty,networkInterfaceNaming"` + + // Does this machine supports hot resize + // Required: false + HotResize bool `url:"hotResize,omitempty" json:"hotResize,omitempty"` } // GetRAM returns RAM field values diff --git a/pkg/cloudapi/kvmx86/kvmx86.go b/pkg/cloudapi/kvmx86/kvmx86.go index fa3ff1e..1ac8498 100644 --- a/pkg/cloudapi/kvmx86/kvmx86.go +++ b/pkg/cloudapi/kvmx86/kvmx86.go @@ -2,7 +2,7 @@ package kvmx86 import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to KVMX86 diff --git a/pkg/cloudapi/lb.go b/pkg/cloudapi/lb.go index 5699d92..b7c950d 100644 --- a/pkg/cloudapi/lb.go +++ b/pkg/cloudapi/lb.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/lb" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/lb" // Accessing the LB method group func (ca *CloudAPI) LB() *lb.LB { diff --git a/pkg/cloudapi/lb/backend_create.go b/pkg/cloudapi/lb/backend_create.go index 3101a06..d051dc8 100644 --- a/pkg/cloudapi/lb/backend_create.go +++ b/pkg/cloudapi/lb/backend_create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendCreateRequest struct to create backend diff --git a/pkg/cloudapi/lb/backend_delete.go b/pkg/cloudapi/lb/backend_delete.go index 28325db..14ce439 100644 --- a/pkg/cloudapi/lb/backend_delete.go +++ b/pkg/cloudapi/lb/backend_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendDeleteRequest struct to delete backend diff --git a/pkg/cloudapi/lb/backend_server_add.go b/pkg/cloudapi/lb/backend_server_add.go index dcab0f9..6e2c321 100644 --- a/pkg/cloudapi/lb/backend_server_add.go +++ b/pkg/cloudapi/lb/backend_server_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendServerAddRequest struct to add server definition to the backend diff --git a/pkg/cloudapi/lb/backend_server_delete.go b/pkg/cloudapi/lb/backend_server_delete.go index 8091c23..839b590 100644 --- a/pkg/cloudapi/lb/backend_server_delete.go +++ b/pkg/cloudapi/lb/backend_server_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendServerDeleteRequest struct to delete server definition diff --git a/pkg/cloudapi/lb/backend_server_update.go b/pkg/cloudapi/lb/backend_server_update.go index 092d9f4..f10b122 100644 --- a/pkg/cloudapi/lb/backend_server_update.go +++ b/pkg/cloudapi/lb/backend_server_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendServerUpdateRequest struct to update server diff --git a/pkg/cloudapi/lb/backend_update.go b/pkg/cloudapi/lb/backend_update.go index 173ffed..7c0bd3b 100644 --- a/pkg/cloudapi/lb/backend_update.go +++ b/pkg/cloudapi/lb/backend_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendUpdateRequest struct to update backend diff --git a/pkg/cloudapi/lb/config_reset.go b/pkg/cloudapi/lb/config_reset.go index e21ccc1..cb38e0c 100644 --- a/pkg/cloudapi/lb/config_reset.go +++ b/pkg/cloudapi/lb/config_reset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ConfigResetRequest struct for reset config diff --git a/pkg/cloudapi/lb/create.go b/pkg/cloudapi/lb/create.go index acb956f..53a17f1 100644 --- a/pkg/cloudapi/lb/create.go +++ b/pkg/cloudapi/lb/create.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create load balancer diff --git a/pkg/cloudapi/lb/delete.go b/pkg/cloudapi/lb/delete.go index dcb00e8..3abfaaa 100644 --- a/pkg/cloudapi/lb/delete.go +++ b/pkg/cloudapi/lb/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete load balancer diff --git a/pkg/cloudapi/lb/disable_enable.go b/pkg/cloudapi/lb/disable_enable.go index 91b0b00..9fb9547 100644 --- a/pkg/cloudapi/lb/disable_enable.go +++ b/pkg/cloudapi/lb/disable_enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableEnableRequest struct for disable/enable load balancer diff --git a/pkg/cloudapi/lb/filter.go b/pkg/cloudapi/lb/filter.go index 1a543dc..65fd906 100644 --- a/pkg/cloudapi/lb/filter.go +++ b/pkg/cloudapi/lb/filter.go @@ -3,8 +3,8 @@ package lb import ( "context" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/k8s" ) // FilterByID returns ListLB with specified ID. diff --git a/pkg/cloudapi/lb/frontend_bind.go b/pkg/cloudapi/lb/frontend_bind.go index a7c3f17..039d4e9 100644 --- a/pkg/cloudapi/lb/frontend_bind.go +++ b/pkg/cloudapi/lb/frontend_bind.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendBindRequest struct for frontend bind diff --git a/pkg/cloudapi/lb/frontend_bind_delete.go b/pkg/cloudapi/lb/frontend_bind_delete.go index 474a69f..b4eea54 100644 --- a/pkg/cloudapi/lb/frontend_bind_delete.go +++ b/pkg/cloudapi/lb/frontend_bind_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendBindDeleteRequest struct to delete bind diff --git a/pkg/cloudapi/lb/frontend_bind_update.go b/pkg/cloudapi/lb/frontend_bind_update.go index eb1918b..cd1ddd2 100644 --- a/pkg/cloudapi/lb/frontend_bind_update.go +++ b/pkg/cloudapi/lb/frontend_bind_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendBindUpdateRequest struct to update binding diff --git a/pkg/cloudapi/lb/frontend_create.go b/pkg/cloudapi/lb/frontend_create.go index 2baa335..618865a 100644 --- a/pkg/cloudapi/lb/frontend_create.go +++ b/pkg/cloudapi/lb/frontend_create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendCreateRequest struct to create frontend diff --git a/pkg/cloudapi/lb/frontend_delete.go b/pkg/cloudapi/lb/frontend_delete.go index 1d09740..a507f87 100644 --- a/pkg/cloudapi/lb/frontend_delete.go +++ b/pkg/cloudapi/lb/frontend_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendDeleteRequest struct to delete frontend diff --git a/pkg/cloudapi/lb/get.go b/pkg/cloudapi/lb/get.go index 83ae1fc..d1d6b35 100644 --- a/pkg/cloudapi/lb/get.go +++ b/pkg/cloudapi/lb/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about load balancer diff --git a/pkg/cloudapi/lb/lb.go b/pkg/cloudapi/lb/lb.go index 04f6ba6..2897643 100644 --- a/pkg/cloudapi/lb/lb.go +++ b/pkg/cloudapi/lb/lb.go @@ -2,7 +2,7 @@ package lb import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to load balancer diff --git a/pkg/cloudapi/lb/list.go b/pkg/cloudapi/lb/list.go index 448fa42..755d089 100644 --- a/pkg/cloudapi/lb/list.go +++ b/pkg/cloudapi/lb/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of load balancers diff --git a/pkg/cloudapi/lb/list_deleted.go b/pkg/cloudapi/lb/list_deleted.go index d2bddff..70977d4 100644 --- a/pkg/cloudapi/lb/list_deleted.go +++ b/pkg/cloudapi/lb/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted load balancers diff --git a/pkg/cloudapi/lb/make_highly_available.go b/pkg/cloudapi/lb/make_highly_available.go index f44c15c..8103907 100644 --- a/pkg/cloudapi/lb/make_highly_available.go +++ b/pkg/cloudapi/lb/make_highly_available.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // HighlyAvailableRequest struct to make Load Balancer Highly available diff --git a/pkg/cloudapi/lb/restart.go b/pkg/cloudapi/lb/restart.go index e279a34..ef33722 100644 --- a/pkg/cloudapi/lb/restart.go +++ b/pkg/cloudapi/lb/restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestartRequest struct to restart load balancer diff --git a/pkg/cloudapi/lb/restore.go b/pkg/cloudapi/lb/restore.go index e8d6391..7dccbce 100644 --- a/pkg/cloudapi/lb/restore.go +++ b/pkg/cloudapi/lb/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore load balancer diff --git a/pkg/cloudapi/lb/serialize.go b/pkg/cloudapi/lb/serialize.go index 89d920f..6e7031a 100644 --- a/pkg/cloudapi/lb/serialize.go +++ b/pkg/cloudapi/lb/serialize.go @@ -3,7 +3,7 @@ package lb import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/lb/start.go b/pkg/cloudapi/lb/start.go index 1b3c192..7706844 100644 --- a/pkg/cloudapi/lb/start.go +++ b/pkg/cloudapi/lb/start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StartRequest struct to start load balancer diff --git a/pkg/cloudapi/lb/stop.go b/pkg/cloudapi/lb/stop.go index ecee20b..4940b43 100644 --- a/pkg/cloudapi/lb/stop.go +++ b/pkg/cloudapi/lb/stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StopRequest struct to stop load balancer diff --git a/pkg/cloudapi/lb/update.go b/pkg/cloudapi/lb/update.go index 322d62c..38306c8 100644 --- a/pkg/cloudapi/lb/update.go +++ b/pkg/cloudapi/lb/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update load balancer diff --git a/pkg/cloudapi/lb/update_sysctl_params.go b/pkg/cloudapi/lb/update_sysctl_params.go index e0a7712..0d8858a 100644 --- a/pkg/cloudapi/lb/update_sysctl_params.go +++ b/pkg/cloudapi/lb/update_sysctl_params.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateSysctParamsRequest struct to update sysct params for lb diff --git a/pkg/cloudapi/locations/list.go b/pkg/cloudapi/locations/list.go index c1a70f4..22f2b95 100644 --- a/pkg/cloudapi/locations/list.go +++ b/pkg/cloudapi/locations/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of locations diff --git a/pkg/cloudapi/locations/locations.go b/pkg/cloudapi/locations/locations.go index c5c579a..8da5328 100644 --- a/pkg/cloudapi/locations/locations.go +++ b/pkg/cloudapi/locations/locations.go @@ -2,7 +2,7 @@ package locations import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to locations diff --git a/pkg/cloudapi/locations/models.go b/pkg/cloudapi/locations/models.go index 87f7b3c..fd0526e 100644 --- a/pkg/cloudapi/locations/models.go +++ b/pkg/cloudapi/locations/models.go @@ -28,6 +28,9 @@ type ItemLocation struct { // CKey CKey string `json:"_ckey"` + + // Support of SDN + SDNSupport bool `json:"sdn_support"` } // List of locations diff --git a/pkg/cloudapi/locations/serialize.go b/pkg/cloudapi/locations/serialize.go index a2df16b..fd79e9a 100644 --- a/pkg/cloudapi/locations/serialize.go +++ b/pkg/cloudapi/locations/serialize.go @@ -3,7 +3,7 @@ package locations import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/locatons.go b/pkg/cloudapi/locatons.go index 742675f..5213ab3 100644 --- a/pkg/cloudapi/locatons.go +++ b/pkg/cloudapi/locatons.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/locations" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/locations" // Accessing the Locations method group func (ca *CloudAPI) Locations() *locations.Locations { diff --git a/pkg/cloudapi/pcidevice.go b/pkg/cloudapi/pcidevice.go index 336c7bc..37aa8ea 100644 --- a/pkg/cloudapi/pcidevice.go +++ b/pkg/cloudapi/pcidevice.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/pcidevice" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/pcidevice" // Accessing the PCI Device method group func (ca *CloudAPI) PCIDevice() *pcidevice.PCIDevice { diff --git a/pkg/cloudapi/pcidevice/list.go b/pkg/cloudapi/pcidevice/list.go index 76a1435..f58562d 100644 --- a/pkg/cloudapi/pcidevice/list.go +++ b/pkg/cloudapi/pcidevice/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of pci devices diff --git a/pkg/cloudapi/pcidevice/pcidevice.go b/pkg/cloudapi/pcidevice/pcidevice.go index 3e16d35..7a42767 100644 --- a/pkg/cloudapi/pcidevice/pcidevice.go +++ b/pkg/cloudapi/pcidevice/pcidevice.go @@ -1,6 +1,6 @@ package pcidevice -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to PCI device type PCIDevice struct { diff --git a/pkg/cloudapi/pcidevice/serialize.go b/pkg/cloudapi/pcidevice/serialize.go index aea3039..56be05c 100644 --- a/pkg/cloudapi/pcidevice/serialize.go +++ b/pkg/cloudapi/pcidevice/serialize.go @@ -3,7 +3,7 @@ package pcidevice import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/prometheus.go b/pkg/cloudapi/prometheus.go new file mode 100644 index 0000000..588c9e4 --- /dev/null +++ b/pkg/cloudapi/prometheus.go @@ -0,0 +1,8 @@ +package cloudapi + +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/prometheus" + +// Accessing the Resmon method group +func (ca *CloudAPI) Prometheus() *prometheus.Prometheus { + return prometheus.New(ca.client) +} diff --git a/pkg/cloudapi/prometheus/compute_cpu_load.go b/pkg/cloudapi/prometheus/compute_cpu_load.go new file mode 100644 index 0000000..2c044dc --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_cpu_load.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeCPULoadRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Per-second CPU time consumed by Compute in percent, average over the time step specified +func (p Prometheus) ComputeCPULoad(ctx context.Context, req ComputeCPULoadRequest) (*PrometheusData, error) { + res, err := p.ComputeCPULoadRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeCPULoadRaw(ctx context.Context, req ComputeCPULoadRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeCPUload" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_memory_available.go b/pkg/cloudapi/prometheus/compute_memory_available.go new file mode 100644 index 0000000..168802c --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_memory_available.go @@ -0,0 +1,53 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeMemoryAvailableRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` +} + +// Available Memory +func (p Prometheus) ComputeMemoryAvailable(ctx context.Context, req ComputeMemoryAvailableRequest) (*PrometheusData, error) { + res, err := p.ComputeMemoryAvailableRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeMemoryAvailableRaw(ctx context.Context, req ComputeMemoryAvailableRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeMemoryAvailable" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_memory_unused.go b/pkg/cloudapi/prometheus/compute_memory_unused.go new file mode 100644 index 0000000..99a2c2e --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_memory_unused.go @@ -0,0 +1,53 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeMemoryUnusedRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` +} + +// Unused Memory +func (p Prometheus) ComputeMemoryUnused(ctx context.Context, req ComputeMemoryUnusedRequest) (*PrometheusData, error) { + res, err := p.ComputeMemoryUnusedRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeMemoryUnusedRaw(ctx context.Context, req ComputeMemoryUnusedRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeMemoryUnused" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_memory_usable.go b/pkg/cloudapi/prometheus/compute_memory_usable.go new file mode 100644 index 0000000..1912855 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_memory_usable.go @@ -0,0 +1,53 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeMemoryUsableRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` +} + +// Usable Memory +func (p Prometheus) ComputeMemoryUsable(ctx context.Context, req ComputeMemoryUsableRequest) (*PrometheusData, error) { + res, err := p.ComputeMemoryUsableRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeMemoryUsableRaw(ctx context.Context, req ComputeMemoryUsableRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeMemoryUsable" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_memory_usage.go b/pkg/cloudapi/prometheus/compute_memory_usage.go new file mode 100644 index 0000000..3b06ea4 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_memory_usage.go @@ -0,0 +1,53 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeMemoryUsageRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` +} + +// Memory Usage +func (p Prometheus) ComputeMemoryUsage(ctx context.Context, req ComputeMemoryUsageRequest) (*PrometheusData, error) { + res, err := p.ComputeMemoryUsageRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeMemoryUsageRaw(ctx context.Context, req ComputeMemoryUsageRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeMemoryUsage" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_memory_used.go b/pkg/cloudapi/prometheus/compute_memory_used.go new file mode 100644 index 0000000..780b9b9 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_memory_used.go @@ -0,0 +1,53 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeMemoryUsedRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` +} + +// Used Memory +func (p Prometheus) ComputeMemoryUsed(ctx context.Context, req ComputeMemoryUsedRequest) (*PrometheusData, error) { + res, err := p.ComputeMemoryUsedRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeMemoryUsedRaw(ctx context.Context, req ComputeMemoryUsedRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeMemoryUsed" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_read_bytes.go b/pkg/cloudapi/prometheus/compute_read_bytes.go new file mode 100644 index 0000000..6be4397 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_read_bytes.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeReadBytesRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Read Bytes +func (p Prometheus) ComputeReadBytes(ctx context.Context, req ComputeReadBytesRequest) (*PrometheusData, error) { + res, err := p.ComputeReadBytesRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeReadBytesRaw(ctx context.Context, req ComputeReadBytesRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeReadBytes" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_read_requests.go b/pkg/cloudapi/prometheus/compute_read_requests.go new file mode 100644 index 0000000..752fdc9 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_read_requests.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeReadRequestsRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Read Requests +func (p Prometheus) ComputeReadRequests(ctx context.Context, req ComputeReadRequestsRequest) (*PrometheusData, error) { + res, err := p.ComputeReadRequestsRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeReadRequestsRaw(ctx context.Context, req ComputeReadRequestsRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeReadRequests" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_receive_bytes.go b/pkg/cloudapi/prometheus/compute_receive_bytes.go new file mode 100644 index 0000000..370be24 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_receive_bytes.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeReceiveBytesRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Receive Bytes +func (p Prometheus) ComputeReceiveBytes(ctx context.Context, req ComputeReceiveBytesRequest) (*PrometheusData, error) { + res, err := p.ComputeReceiveBytesRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeReceiveBytesRaw(ctx context.Context, req ComputeReceiveBytesRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeReceiveBytes" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_receive_packets.go b/pkg/cloudapi/prometheus/compute_receive_packets.go new file mode 100644 index 0000000..ecc6cca --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_receive_packets.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeReceivePacketsRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Receive Packets +func (p Prometheus) ComputeReceivePackets(ctx context.Context, req ComputeReceivePacketsRequest) (*PrometheusData, error) { + res, err := p.ComputeReceivePacketsRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeReceivePacketsRaw(ctx context.Context, req ComputeReceivePacketsRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeReceivePackets" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_transmit_bytes.go b/pkg/cloudapi/prometheus/compute_transmit_bytes.go new file mode 100644 index 0000000..e41b221 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_transmit_bytes.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeTransmitBytesRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Transmit Bytes +func (p Prometheus) ComputeTransmitBytes(ctx context.Context, req ComputeTransmitBytesRequest) (*PrometheusData, error) { + res, err := p.ComputeTransmitBytesRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeTransmitBytesRaw(ctx context.Context, req ComputeTransmitBytesRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeTransmitBytes" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_transmit_packets.go b/pkg/cloudapi/prometheus/compute_transmit_packets.go new file mode 100644 index 0000000..3a9f374 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_transmit_packets.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeTransmitPacketsRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Transmit Packets +func (p Prometheus) ComputeTransmitPackets(ctx context.Context, req ComputeTransmitPacketsRequest) (*PrometheusData, error) { + res, err := p.ComputeTransmitPacketsRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeTransmitPacketsRaw(ctx context.Context, req ComputeTransmitPacketsRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeTransmitPackets" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_write_bytes.go b/pkg/cloudapi/prometheus/compute_write_bytes.go new file mode 100644 index 0000000..bab82c8 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_write_bytes.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeWriteBytesRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Write Bytes +func (p Prometheus) ComputeWriteBytes(ctx context.Context, req ComputeWriteBytesRequest) (*PrometheusData, error) { + res, err := p.ComputeWriteBytesRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeWriteBytesRaw(ctx context.Context, req ComputeWriteBytesRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeWriteBytes" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/compute_write_requests.go b/pkg/cloudapi/prometheus/compute_write_requests.go new file mode 100644 index 0000000..414b016 --- /dev/null +++ b/pkg/cloudapi/prometheus/compute_write_requests.go @@ -0,0 +1,57 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type ComputeWriteRequestsRequest struct { + // Compute ID + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Write Requests +func (p Prometheus) ComputeWriteRequests(ctx context.Context, req ComputeWriteRequestsRequest) (*PrometheusData, error) { + res, err := p.ComputeWriteRequestsRaw(ctx, req) + if err != nil { + return nil, err + } + + info := PrometheusData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputeWriteRequestsRaw(ctx context.Context, req ComputeWriteRequestsRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computeWriteRequests" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/computes.go b/pkg/cloudapi/prometheus/computes.go new file mode 100644 index 0000000..2795dc6 --- /dev/null +++ b/pkg/cloudapi/prometheus/computes.go @@ -0,0 +1,77 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +const ( + ComputeCPULoad = "computeCPUload" + ComputeMemoryUsage = "computeMemoryUsage" + ComputeMemoryUsable = "computeMemoryUsable" + ComputeMemoryUnused = "computeMemoryUnused" + ComputeMemoryUsed = "computeMemoryUsed" + ComputeMemoryAvailable = "computeMemoryAvailable" + ComputeReadBytes = "computeReadBytes" + ComputeReadRequests = "computeReadRequests" + ComputeReceiveBytes = "computeReceiveBytes" + ComputeTransmitBytes = "computeTransmitBytes" + ComputeTransmitPackets = "computeTransmitPackets" + ComputeWriteBytes = "computeWriteBytes" + ComputeWriteRequests = "computeWriteRequests" +) + +type ComputesRequest struct { + // List of compute IDs to fetch metrics for + // Required: true + ComputeIDs []uint64 `url:"computeIds" json:"computeIds" validate:"required"` + + // List of compute IDs to fetch metrics for + // Required: true + MetricIDs []string `url:"metricIds" json:"metricIds" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Get multiple metrics for multiple compute instances +func (p Prometheus) Computes(ctx context.Context, req ComputesRequest) (*ComputesData, error) { + res, err := p.ComputesRaw(ctx, req) + if err != nil { + return nil, err + } + + info := ComputesData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputesRaw(ctx context.Context, req ComputesRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/prometheus/computes" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/prometheus/models.go b/pkg/cloudapi/prometheus/models.go new file mode 100644 index 0000000..76ee3bc --- /dev/null +++ b/pkg/cloudapi/prometheus/models.go @@ -0,0 +1,40 @@ +package prometheus + +// PrometheusData represents an array of data points +type PrometheusData []PrometheusPoint + +// PrometheusPoint represents a single data point +type PrometheusPoint struct { + // Value of the metric at a specific point in time + Value float64 `json:"value"` + + // Timestamp the Unix timestamp. + Timestamp uint64 `json:"timestamp"` +} + +// ComputesData represents an array of data points for computes +type ComputesData []ItemCompute + +// ItemCompute represents a single data of compute +type ItemCompute struct { + // Compute ID + ComputeID uint64 `json:"computeId"` + + // Array of metrics + Metrics []ItemMetric `json:"metrics"` + + // Error + Error string `json:"error"` +} + +// ItemMetric represents a single data point of metric +type ItemMetric struct { + // Metric ID + MetricID string `json:"metricId"` + + // Data represents an array of data points + Data PrometheusData `json:"data"` + + // Error + Error string `json:"error"` +} diff --git a/pkg/cloudapi/prometheus/prometheus.go b/pkg/cloudapi/prometheus/prometheus.go new file mode 100644 index 0000000..a3012ca --- /dev/null +++ b/pkg/cloudapi/prometheus/prometheus.go @@ -0,0 +1,15 @@ +package prometheus + +import ( + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" +) + +type Prometheus struct { + client interfaces.Caller +} + +func New(client interfaces.Caller) *Prometheus { + return &Prometheus{ + client: client, + } +} diff --git a/pkg/cloudapi/rg.go b/pkg/cloudapi/rg.go index 60901aa..24959cd 100644 --- a/pkg/cloudapi/rg.go +++ b/pkg/cloudapi/rg.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/rg" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/rg" // Accessing the RG method group func (ca *CloudAPI) RG() *rg.RG { diff --git a/pkg/cloudapi/rg/access_grant.go b/pkg/cloudapi/rg/access_grant.go index 9ee839a..f9e7176 100644 --- a/pkg/cloudapi/rg/access_grant.go +++ b/pkg/cloudapi/rg/access_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessGrantRequest struct to grant access to resource group diff --git a/pkg/cloudapi/rg/access_revoke.go b/pkg/cloudapi/rg/access_revoke.go index ca53d7a..e3c324c 100644 --- a/pkg/cloudapi/rg/access_revoke.go +++ b/pkg/cloudapi/rg/access_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessRevokeRequest struct to revoke access diff --git a/pkg/cloudapi/rg/affinity_group_computes.go b/pkg/cloudapi/rg/affinity_group_computes.go index b61f78b..c1ce1fc 100644 --- a/pkg/cloudapi/rg/affinity_group_computes.go +++ b/pkg/cloudapi/rg/affinity_group_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupComputesRequest struct to get list of all computes with their relationships diff --git a/pkg/cloudapi/rg/affinity_groups_get.go b/pkg/cloudapi/rg/affinity_groups_get.go index d0463aa..3a84879 100644 --- a/pkg/cloudapi/rg/affinity_groups_get.go +++ b/pkg/cloudapi/rg/affinity_groups_get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupsGetRequest struct to get list computes from affinity group diff --git a/pkg/cloudapi/rg/affinity_groups_list.go b/pkg/cloudapi/rg/affinity_groups_list.go index fc16421..29d8ddc 100644 --- a/pkg/cloudapi/rg/affinity_groups_list.go +++ b/pkg/cloudapi/rg/affinity_groups_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupsListRequest struct to get list of affinity groups from resource group diff --git a/pkg/cloudapi/rg/audits.go b/pkg/cloudapi/rg/audits.go index 17990d5..8018a5d 100644 --- a/pkg/cloudapi/rg/audits.go +++ b/pkg/cloudapi/rg/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to get audit diff --git a/pkg/cloudapi/rg/create.go b/pkg/cloudapi/rg/create.go index 13b7456..9cb4dbd 100644 --- a/pkg/cloudapi/rg/create.go +++ b/pkg/cloudapi/rg/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create resource group @@ -71,10 +71,6 @@ type CreateRequest struct { // External IP address // Required: false ExtIP string `url:"extIp,omitempty" json:"extIp,omitempty"` - - // Register computes in registration system - // Required: false - RegisterComputes bool `url:"registerComputes,omitempty" json:"registerComputes,omitempty"` } // Create creates resource group diff --git a/pkg/cloudapi/rg/delete.go b/pkg/cloudapi/rg/delete.go index b88e3f9..703a358 100644 --- a/pkg/cloudapi/rg/delete.go +++ b/pkg/cloudapi/rg/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete resource group diff --git a/pkg/cloudapi/rg/disable.go b/pkg/cloudapi/rg/disable.go index 5e03cfd..23b12f8 100644 --- a/pkg/cloudapi/rg/disable.go +++ b/pkg/cloudapi/rg/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable resource group diff --git a/pkg/cloudapi/rg/enable.go b/pkg/cloudapi/rg/enable.go index 6aa2a75..f1be19e 100644 --- a/pkg/cloudapi/rg/enable.go +++ b/pkg/cloudapi/rg/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable resource group diff --git a/pkg/cloudapi/rg/filter_test.go b/pkg/cloudapi/rg/filter_test.go index 5caab07..a97dad2 100644 --- a/pkg/cloudapi/rg/filter_test.go +++ b/pkg/cloudapi/rg/filter_test.go @@ -17,20 +17,19 @@ var rgs = ListResourceGroups{ UserGroupID: "sample_user_1@decs3o", }, }, - CreatedBy: "sample_user_1@decs3o", - CreatedTime: 1676645305, - DefNetID: 1, - DefNetType: "NONE", - DeletedBy: "", - DeletedTime: 0, - Description: "", - GID: 212, - GUID: 7971, - ID: 7971, - LockStatus: "UNLOCKED", - Milestones: 363459, - Name: "rg_1", - RegisterComputes: false, + CreatedBy: "sample_user_1@decs3o", + CreatedTime: 1676645305, + DefNetID: 1, + DefNetType: "NONE", + DeletedBy: "", + DeletedTime: 0, + Description: "", + GID: 212, + GUID: 7971, + ID: 7971, + LockStatus: "UNLOCKED", + Milestones: 363459, + Name: "rg_1", ResourceLimits: ResourceLimits{ CUC: -1, CUI: -1, @@ -60,20 +59,19 @@ var rgs = ListResourceGroups{ UserGroupID: "sample_user_1@decs3o", }, }, - CreatedBy: "sample_user_1@decs3o", - CreatedTime: 1676645461, - DefNetID: 2, - DefNetType: "NONE", - DeletedBy: "", - DeletedTime: 0, - Description: "", - GID: 212, - GUID: 7972, - ID: 7972, - LockStatus: "UNLOCKED", - Milestones: 363468, - Name: "rg_2", - RegisterComputes: false, + CreatedBy: "sample_user_1@decs3o", + CreatedTime: 1676645461, + DefNetID: 2, + DefNetType: "NONE", + DeletedBy: "", + DeletedTime: 0, + Description: "", + GID: 212, + GUID: 7972, + ID: 7972, + LockStatus: "UNLOCKED", + Milestones: 363468, + Name: "rg_2", ResourceLimits: ResourceLimits{ CUC: -1, CUI: -1, @@ -103,20 +101,19 @@ var rgs = ListResourceGroups{ UserGroupID: "sample_user_2@decs3o", }, }, - CreatedBy: "sample_user_2@decs3o", - CreatedTime: 1676645548, - DefNetID: 3, - DefNetType: "NONE", - DeletedBy: "", - DeletedTime: 0, - Description: "", - GID: 212, - GUID: 7973, - ID: 7973, - LockStatus: "kjLOCKED", - Milestones: 363471, - Name: "rg_3", - RegisterComputes: false, + CreatedBy: "sample_user_2@decs3o", + CreatedTime: 1676645548, + DefNetID: 3, + DefNetType: "NONE", + DeletedBy: "", + DeletedTime: 0, + Description: "", + GID: 212, + GUID: 7973, + ID: 7973, + LockStatus: "kjLOCKED", + Milestones: 363471, + Name: "rg_3", ResourceLimits: ResourceLimits{ CUC: -1, CUI: -1, diff --git a/pkg/cloudapi/rg/get.go b/pkg/cloudapi/rg/get.go index 16e5f45..4d41714 100644 --- a/pkg/cloudapi/rg/get.go +++ b/pkg/cloudapi/rg/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about resource group diff --git a/pkg/cloudapi/rg/get_resource_consumption.go b/pkg/cloudapi/rg/get_resource_consumption.go index 63a7025..10ec9e1 100644 --- a/pkg/cloudapi/rg/get_resource_consumption.go +++ b/pkg/cloudapi/rg/get_resource_consumption.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetResourceConsumptionRequest struct to get detailed information about resource consumption for ResGroup diff --git a/pkg/cloudapi/rg/list.go b/pkg/cloudapi/rg/list.go index 271b26f..34f0efc 100644 --- a/pkg/cloudapi/rg/list.go +++ b/pkg/cloudapi/rg/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of resource groups diff --git a/pkg/cloudapi/rg/list_computes.go b/pkg/cloudapi/rg/list_computes.go index 9aa8d61..0b52b47 100644 --- a/pkg/cloudapi/rg/list_computes.go +++ b/pkg/cloudapi/rg/list_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListComputesRequest struct to get list of computes diff --git a/pkg/cloudapi/rg/list_deleted.go b/pkg/cloudapi/rg/list_deleted.go index f32cad8..842fbca 100644 --- a/pkg/cloudapi/rg/list_deleted.go +++ b/pkg/cloudapi/rg/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list deleted resource groups diff --git a/pkg/cloudapi/rg/list_lb.go b/pkg/cloudapi/rg/list_lb.go index 3b2ccb4..2ee776a 100644 --- a/pkg/cloudapi/rg/list_lb.go +++ b/pkg/cloudapi/rg/list_lb.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListLBRequest struct to get list of load balancers diff --git a/pkg/cloudapi/rg/list_pfw.go b/pkg/cloudapi/rg/list_pfw.go index d2293e2..cc3f2dc 100644 --- a/pkg/cloudapi/rg/list_pfw.go +++ b/pkg/cloudapi/rg/list_pfw.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListPFWRequest struct to get list of port forward rules diff --git a/pkg/cloudapi/rg/list_vins.go b/pkg/cloudapi/rg/list_vins.go index 7951f3a..045b2b2 100644 --- a/pkg/cloudapi/rg/list_vins.go +++ b/pkg/cloudapi/rg/list_vins.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListVINSRequest struct to get list of VINSes diff --git a/pkg/cloudapi/rg/models.go b/pkg/cloudapi/rg/models.go index 4f418ab..6232570 100644 --- a/pkg/cloudapi/rg/models.go +++ b/pkg/cloudapi/rg/models.go @@ -128,9 +128,6 @@ type RecordResourceGroup struct { // Name Name string `json:"name"` - // RegisterComputes - RegisterComputes bool `json:"registerComputes"` - // Resource limits ResourceLimits ResourceLimits `json:"resourceLimits"` @@ -224,9 +221,6 @@ type ItemResourceGroup struct { // Name Name string `json:"name"` - // RegisterComputes - RegisterComputes bool `json:"registerComputes"` - // Resource limits ResourceLimits ResourceLimits `json:"resourceLimits"` diff --git a/pkg/cloudapi/rg/remove_def_net.go b/pkg/cloudapi/rg/remove_def_net.go index 5992e39..47fbf2b 100644 --- a/pkg/cloudapi/rg/remove_def_net.go +++ b/pkg/cloudapi/rg/remove_def_net.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RemoveDefNetRequest struct to remove default network diff --git a/pkg/cloudapi/rg/restore.go b/pkg/cloudapi/rg/restore.go index fdf875f..ab16d70 100644 --- a/pkg/cloudapi/rg/restore.go +++ b/pkg/cloudapi/rg/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore resource group diff --git a/pkg/cloudapi/rg/rg.go b/pkg/cloudapi/rg/rg.go index 1868a89..eb10e33 100644 --- a/pkg/cloudapi/rg/rg.go +++ b/pkg/cloudapi/rg/rg.go @@ -2,7 +2,7 @@ package rg import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to resource group diff --git a/pkg/cloudapi/rg/serialize.go b/pkg/cloudapi/rg/serialize.go index 1d5030f..9becc06 100644 --- a/pkg/cloudapi/rg/serialize.go +++ b/pkg/cloudapi/rg/serialize.go @@ -3,7 +3,7 @@ package rg import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/rg/set_def_net.go b/pkg/cloudapi/rg/set_def_net.go index 20be4a7..ca60c56 100644 --- a/pkg/cloudapi/rg/set_def_net.go +++ b/pkg/cloudapi/rg/set_def_net.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetDefNetRequest struct to set default network diff --git a/pkg/cloudapi/rg/update.go b/pkg/cloudapi/rg/update.go index 9ae2a15..1153653 100644 --- a/pkg/cloudapi/rg/update.go +++ b/pkg/cloudapi/rg/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update resource group @@ -42,10 +42,6 @@ type UpdateRequest struct { // Required: false MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"` - // Register computes in registration system - // Required: false - RegisterComputes bool `url:"registerComputes,omitempty" json:"registerComputes,omitempty"` - // List of strings with pools i.e.: ["sep1_poolName1", "sep2_poolName2", etc] // Required: false UniqPools []string `url:"uniqPools,omitempty" json:"uniqPools,omitempty"` diff --git a/pkg/cloudapi/rg/usage.go b/pkg/cloudapi/rg/usage.go index c583cd1..01b06b9 100644 --- a/pkg/cloudapi/rg/usage.go +++ b/pkg/cloudapi/rg/usage.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UsageRequest struct to get report of resource usage diff --git a/pkg/cloudapi/sep.go b/pkg/cloudapi/sep.go new file mode 100644 index 0000000..7a6bb90 --- /dev/null +++ b/pkg/cloudapi/sep.go @@ -0,0 +1,8 @@ +package cloudapi + +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/sep" + +// Accessing the SEP method group +func (cb *CloudAPI) SEP() *sep.SEP { + return sep.New(cb.client) +} diff --git a/pkg/cloudapi/sep/filter.go b/pkg/cloudapi/sep/filter.go new file mode 100644 index 0000000..b97bd45 --- /dev/null +++ b/pkg/cloudapi/sep/filter.go @@ -0,0 +1,83 @@ +package sep + +// FilterBySEPID returns ListAvailableSEP with the specified SEPID. +func (sl ListAvailableSEP) FilterBySEPID(sepID uint64) ListAvailableSEP { + predicate := func(sd SEPData) bool { + return sd.SEPID == sepID + } + + return sl.FilterFunc(predicate) +} + +// FilterBySEPName returns ListAvailableSEP with the specified SEPName. +func (sl ListAvailableSEP) FilterBySEPName(SEPName string) ListAvailableSEP { + predicate := func(sd SEPData) bool { + return sd.SEPName == SEPName + } + + return sl.FilterFunc(predicate) +} + +// FilterBySEPType returns ListAvailableSEP with the specified SEPType. +func (sl ListAvailableSEP) FilterBySEPType(SEPType string) ListAvailableSEP { + predicate := func(sd SEPData) bool { + return sd.SEPType == SEPType + } + + return sl.FilterFunc(predicate) +} + +// FilterByPoolType returns ListAvailableSEP where at least one pool has the specified type. +func (sl ListAvailableSEP) FilterByPoolType(poolType string) ListAvailableSEP { + predicate := func(sd SEPData) bool { + for _, pool := range sd.Pools { + for _, pt := range pool.Types { + if pt == poolType { + return true + } + } + } + return false + } + + return sl.FilterFunc(predicate) +} + +// FilterBySystemPool returns ListAvailableSEP where at least one pool is a system pool. +func (sl ListAvailableSEP) FilterBySystemPool(isSystem bool) ListAvailableSEP { + predicate := func(sd SEPData) bool { + for _, pool := range sd.Pools { + if pool.System == isSystem { + return true + } + } + return false + } + + return sl.FilterFunc(predicate) +} + +// FilterFunc allows filtering ListAvailableSEP based on a user-defined predicate. +func (sl ListAvailableSEP) FilterFunc(predicate func(SEPData) bool) ListAvailableSEP { + var result ListAvailableSEP + + for _, item := range sl.Data { + if predicate(item) { + result.Data = append(result.Data, item) + } + } + + result.EntryCount = uint64(len(result.Data)) + + return result +} + +// FindOne returns the first found SEPData. +// If nothing is found, returns an empty struct. +func (sl ListAvailableSEP) FindOne() SEPData { + if len(sl.Data) == 0 { + return SEPData{} + } + + return sl.Data[0] +} diff --git a/pkg/cloudapi/sep/filter_test.go b/pkg/cloudapi/sep/filter_test.go new file mode 100644 index 0000000..979f907 --- /dev/null +++ b/pkg/cloudapi/sep/filter_test.go @@ -0,0 +1,134 @@ +package sep + +import ( + "testing" +) + +var seps = ListAvailableSEP{ + EntryCount: 3, + Data: []SEPData{ + { + SEPID: 1, + SEPName: "sep_1", + SEPType: "TATLIN", + Pools: []Pool{ + { + Name: "pool_1", + Types: []string{"DES"}, + System: false, + }, + }, + }, + { + SEPID: 2, + SEPName: "sep_2", + SEPType: "SHARED", + Pools: []Pool{ + { + Name: "pool_2", + Types: []string{"DES"}, + System: true, + }, + }, + }, + { + SEPID: 3, + SEPName: "sep_3", + SEPType: "DES", + Pools: []Pool{ + { + Name: "pool_3", + Types: []string{"DES"}, + System: false, + }, + }, + }, + }, +} + +func TestFilterBySEPID(t *testing.T) { + actual := seps.FilterBySEPID(1).FindOne() + + if actual.SEPID != 1 { + t.Fatal("expected SEPID 1, found: ", actual.SEPID) + } +} + +func TestFilterBySEPName(t *testing.T) { + actual := seps.FilterBySEPName("sep_2").FindOne() + + if actual.SEPName != "sep_2" { + t.Fatal("expected SEPName 'sep_2', found: ", actual.SEPName) + } +} + +func TestFilterBySEPType(t *testing.T) { + actual := seps.FilterBySEPType("TATLIN").FindOne() + + if actual.SEPType != "TATLIN" { + t.Fatal("expected SEPType 'TATLIN', found: ", actual.SEPType) + } +} + +func TestFilterByPoolType(t *testing.T) { + actual := seps.FilterByPoolType("DES") + + if len(actual.Data) != 3 { + t.Fatal("expected 3 found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + found := false + for _, pool := range item.Pools { + for _, poolType := range pool.Types { + if poolType == "DES" { + found = true + break + } + } + if found { + break + } + } + if !found { + t.Fatal("expected Pool type 'DES', not found in SEP: ", item.SEPID) + } + } +} + +func TestFilterBySystemPool(t *testing.T) { + actual := seps.FilterBySystemPool(true) + + if len(actual.Data) != 1 { + t.Fatal("expected 1 found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + found := false + for _, pool := range item.Pools { + if pool.System { + found = true + break + } + } + if !found { + t.Fatal("expected System pool, not found in SEP: ", item.SEPID) + } + } +} + +func TestFilterFunc(t *testing.T) { + actual := seps.FilterFunc(func(sd SEPData) bool { + return len(sd.Pools) > 0 + }) + + if len(actual.Data) != 3 { + t.Fatal("expected 3 found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + if len(item.Pools) == 0 { + t.Fatal("expected Pools to contain at least 1 element, found: ", len(item.Pools)) + } + } +} diff --git a/pkg/cloudapi/sep/ids.go b/pkg/cloudapi/sep/ids.go new file mode 100644 index 0000000..aea3dea --- /dev/null +++ b/pkg/cloudapi/sep/ids.go @@ -0,0 +1,10 @@ +package sep + +// IDs gets array of SEPIDs from ListSEP struct +func (ls ListAvailableSEP) IDs() []uint64 { + res := make([]uint64, 0, len(ls.Data)) + for _, s := range ls.Data { + res = append(res, s.SEPID) + } + return res +} diff --git a/pkg/cloudapi/sep/list_available_sep_and_pools.go b/pkg/cloudapi/sep/list_available_sep_and_pools.go new file mode 100644 index 0000000..b701244 --- /dev/null +++ b/pkg/cloudapi/sep/list_available_sep_and_pools.go @@ -0,0 +1,52 @@ +package sep + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// ListAvailableSEPAndPoolsRequest struct to get dict with entry count and list of dict with SEPs and pools details accessible by the Account and RG +type ListAvailableSEPAndPoolsRequest struct { + // Account ID + // Required: true + AccountID uint64 `url:"account_id" json:"account_id" validate:"required"` + + // RG ID + // Required: false + RGID uint64 `url:"rg_id,omitempty" json:"rg_id,omitempty"` +} + +// ListAvailableSEPAndPools get dict with entry count and list of dict with SEPs and pools details accessible by the Account and RG +func (s SEP) ListAvailableSEPAndPools(ctx context.Context, req ListAvailableSEPAndPoolsRequest) (*ListAvailableSEP, error) { + + res, err := s.ListAvailableSEPAndPoolsRaw(ctx, req) + if err != nil { + return nil, err + } + + list := ListAvailableSEP{} + + err = json.Unmarshal(res, &list) + if err != nil { + return nil, err + } + + return &list, nil +} + +// ListRaw gets list as an array of bytes +func (s SEP) ListAvailableSEPAndPoolsRaw(ctx context.Context, req ListAvailableSEPAndPoolsRequest) ([]byte, error) { + + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudapi/sep/listAvailableSepAndPools" + + res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudapi/sep/models.go b/pkg/cloudapi/sep/models.go new file mode 100644 index 0000000..e32e540 --- /dev/null +++ b/pkg/cloudapi/sep/models.go @@ -0,0 +1,34 @@ +package sep + +type Pool struct { + // Pool name + Name string `json:"name"` + + // Pool types + Types []string `json:"types"` + + // System + System bool `json:"system"` +} + +type SEPData struct { + // SEP ID + SEPID uint64 `json:"sepId"` + + // SEP name + SEPName string `json:"sepName"` + + // Sep type + SEPType string `json:"sepType"` + + // Pools + Pools []Pool `json:"pools"` +} + +type ListAvailableSEP struct { + // Entry count + EntryCount uint64 `json:"entryCount"` + + // Data + Data []SEPData `json:"data"` +} diff --git a/pkg/cloudapi/sep/sep.go b/pkg/cloudapi/sep/sep.go new file mode 100644 index 0000000..26fb750 --- /dev/null +++ b/pkg/cloudapi/sep/sep.go @@ -0,0 +1,18 @@ +// Operator actions for handling interventions on a storage endpoint provider +package sep + +import ( + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" +) + +// Structure for creating request to storage endpoint provider +type SEP struct { + client interfaces.Caller +} + +// Builder for SEP endpoints +func New(client interfaces.Caller) *SEP { + return &SEP{ + client: client, + } +} diff --git a/pkg/cloudapi/sep/serialize.go b/pkg/cloudapi/sep/serialize.go new file mode 100644 index 0000000..6a9b89f --- /dev/null +++ b/pkg/cloudapi/sep/serialize.go @@ -0,0 +1,43 @@ +package sep + +import ( + "encoding/json" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" +) + +// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. +// +// In order to serialize with indent make sure to follow these guidelines: +// - First argument -> prefix +// - Second argument -> indent +func (lsep ListAvailableSEP) Serialize(params ...string) (serialization.Serialized, error) { + if len(lsep.Data) == 0 { + return []byte{}, nil + } + + if len(params) > 1 { + prefix := params[0] + indent := params[1] + + return json.MarshalIndent(lsep, prefix, indent) + } + + return json.Marshal(lsep) +} + +// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. +// +// In order to serialize with indent make sure to follow these guidelines: +// - First argument -> prefix +// - Second argument -> indent +func (rsep SEPData) Serialize(params ...string) (serialization.Serialized, error) { + if len(params) > 1 { + prefix := params[0] + indent := params[1] + + return json.MarshalIndent(rsep, prefix, indent) + } + + return json.Marshal(rsep) +} diff --git a/pkg/cloudapi/stack.go b/pkg/cloudapi/stack.go index 492e1b4..dd5b7f8 100644 --- a/pkg/cloudapi/stack.go +++ b/pkg/cloudapi/stack.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/stack" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/stack" ) // Accessing the Stack method group diff --git a/pkg/cloudapi/stack/get.go b/pkg/cloudapi/stack/get.go index 54a49e0..57e7154 100644 --- a/pkg/cloudapi/stack/get.go +++ b/pkg/cloudapi/stack/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get info of stack diff --git a/pkg/cloudapi/stack/list.go b/pkg/cloudapi/stack/list.go index 424d115..95d1ee9 100644 --- a/pkg/cloudapi/stack/list.go +++ b/pkg/cloudapi/stack/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of stacks diff --git a/pkg/cloudapi/stack/stack.go b/pkg/cloudapi/stack/stack.go index 65ffe5b..1882be2 100644 --- a/pkg/cloudapi/stack/stack.go +++ b/pkg/cloudapi/stack/stack.go @@ -1,7 +1,7 @@ // Lists all the stack. package stack -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to stack type Stack struct { diff --git a/pkg/cloudapi/tasks.go b/pkg/cloudapi/tasks.go index 62e94f6..3cafe78 100644 --- a/pkg/cloudapi/tasks.go +++ b/pkg/cloudapi/tasks.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/tasks" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/tasks" ) // Accessing the Tasks method group diff --git a/pkg/cloudapi/tasks/get.go b/pkg/cloudapi/tasks/get.go index aacc159..94c2e4b 100644 --- a/pkg/cloudapi/tasks/get.go +++ b/pkg/cloudapi/tasks/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about task diff --git a/pkg/cloudapi/tasks/list.go b/pkg/cloudapi/tasks/list.go index 66af731..9fa6898 100644 --- a/pkg/cloudapi/tasks/list.go +++ b/pkg/cloudapi/tasks/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of tasks diff --git a/pkg/cloudapi/tasks/tasks.go b/pkg/cloudapi/tasks/tasks.go index 5e12827..cb90367 100644 --- a/pkg/cloudapi/tasks/tasks.go +++ b/pkg/cloudapi/tasks/tasks.go @@ -2,7 +2,7 @@ package tasks import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to tasks diff --git a/pkg/cloudapi/user.go b/pkg/cloudapi/user.go index 457cfe3..fedff59 100644 --- a/pkg/cloudapi/user.go +++ b/pkg/cloudapi/user.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/user" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/user" func (ca *CloudAPI) User() *user.User { return user.New(ca.client) diff --git a/pkg/cloudapi/user/api_list.go b/pkg/cloudapi/user/api_list.go index 00db665..4f93a18 100644 --- a/pkg/cloudapi/user/api_list.go +++ b/pkg/cloudapi/user/api_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // APIListRequest struct for getting API list. diff --git a/pkg/cloudapi/user/authenticate.go b/pkg/cloudapi/user/authenticate.go index 4b03eb5..e6ee50f 100644 --- a/pkg/cloudapi/user/authenticate.go +++ b/pkg/cloudapi/user/authenticate.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuthenticateRequest struct to authenticate user. diff --git a/pkg/cloudapi/user/get.go b/pkg/cloudapi/user/get.go index d2305e1..5b93a43 100644 --- a/pkg/cloudapi/user/get.go +++ b/pkg/cloudapi/user/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get user details. diff --git a/pkg/cloudapi/user/get_audit.go b/pkg/cloudapi/user/get_audit.go index 43287dc..3253c88 100644 --- a/pkg/cloudapi/user/get_audit.go +++ b/pkg/cloudapi/user/get_audit.go @@ -28,6 +28,10 @@ type GetAuditRequest struct { // Required: false MinStatusCode uint64 `url:"minStatusCode,omitempty" json:"minStatusCode,omitempty"` + // Sort by one of supported fields, format +|-(field) + // Required: false + SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` + // Page number. // Required: false Page uint64 `url:"page,omitempty" json:"page,omitempty"` diff --git a/pkg/cloudapi/user/is_valid_invite_user_token.go b/pkg/cloudapi/user/is_valid_invite_user_token.go index d2682f1..d8cfd56 100644 --- a/pkg/cloudapi/user/is_valid_invite_user_token.go +++ b/pkg/cloudapi/user/is_valid_invite_user_token.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to check if the inviteusertoken and emailaddress pair are valid and matching. diff --git a/pkg/cloudapi/user/set_data.go b/pkg/cloudapi/user/set_data.go index 5e927e0..30a2eec 100644 --- a/pkg/cloudapi/user/set_data.go +++ b/pkg/cloudapi/user/set_data.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetDataRequest struct for setting extra user information. diff --git a/pkg/cloudapi/user/user.go b/pkg/cloudapi/user/user.go index 2fe152a..cd5cfb7 100644 --- a/pkg/cloudapi/user/user.go +++ b/pkg/cloudapi/user/user.go @@ -1,6 +1,6 @@ package user -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to User type User struct { diff --git a/pkg/cloudapi/vfpool.go b/pkg/cloudapi/vfpool.go index 0388715..0a7c8e7 100644 --- a/pkg/cloudapi/vfpool.go +++ b/pkg/cloudapi/vfpool.go @@ -1,6 +1,6 @@ package cloudapi -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/vfpool" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/vfpool" // Accessing the VFPool method group func (ca *CloudAPI) VFPool() *vfpool.VFPool { diff --git a/pkg/cloudapi/vfpool/get.go b/pkg/cloudapi/vfpool/get.go index e2e7172..35d97d4 100644 --- a/pkg/cloudapi/vfpool/get.go +++ b/pkg/cloudapi/vfpool/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about vfpool device diff --git a/pkg/cloudapi/vfpool/list.go b/pkg/cloudapi/vfpool/list.go index 6a9649a..af586d4 100644 --- a/pkg/cloudapi/vfpool/list.go +++ b/pkg/cloudapi/vfpool/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of vfpool devices diff --git a/pkg/cloudapi/vfpool/serialize.go b/pkg/cloudapi/vfpool/serialize.go index c40fc44..a0347d1 100644 --- a/pkg/cloudapi/vfpool/serialize.go +++ b/pkg/cloudapi/vfpool/serialize.go @@ -3,7 +3,7 @@ package vfpool import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/vfpool/vfpool.go b/pkg/cloudapi/vfpool/vfpool.go index f952dee..d8ca096 100644 --- a/pkg/cloudapi/vfpool/vfpool.go +++ b/pkg/cloudapi/vfpool/vfpool.go @@ -2,7 +2,7 @@ package vfpool import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to vfpool diff --git a/pkg/cloudapi/vins.go b/pkg/cloudapi/vins.go index 6421324..78b3651 100644 --- a/pkg/cloudapi/vins.go +++ b/pkg/cloudapi/vins.go @@ -1,7 +1,7 @@ package cloudapi import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi/vins" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi/vins" ) // Accessing the VINS method group diff --git a/pkg/cloudapi/vins/audits.go b/pkg/cloudapi/vins/audits.go index 5a59365..b6bba8a 100644 --- a/pkg/cloudapi/vins/audits.go +++ b/pkg/cloudapi/vins/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to get audits diff --git a/pkg/cloudapi/vins/create_in_account.go b/pkg/cloudapi/vins/create_in_account.go index 8c3eb84..fa64fbb 100644 --- a/pkg/cloudapi/vins/create_in_account.go +++ b/pkg/cloudapi/vins/create_in_account.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type Route struct { diff --git a/pkg/cloudapi/vins/create_in_rg.go b/pkg/cloudapi/vins/create_in_rg.go index 4213181..24f00d4 100644 --- a/pkg/cloudapi/vins/create_in_rg.go +++ b/pkg/cloudapi/vins/create_in_rg.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateInRGRequest struct to create VINS in resource group diff --git a/pkg/cloudapi/vins/delete.go b/pkg/cloudapi/vins/delete.go index 53cc0cb..20b26f2 100644 --- a/pkg/cloudapi/vins/delete.go +++ b/pkg/cloudapi/vins/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete VINS diff --git a/pkg/cloudapi/vins/disable_enable.go b/pkg/cloudapi/vins/disable_enable.go index 7d3186e..5fc0502 100644 --- a/pkg/cloudapi/vins/disable_enable.go +++ b/pkg/cloudapi/vins/disable_enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableEnableRequest struct to disable/enable VINS diff --git a/pkg/cloudapi/vins/dns_apply.go b/pkg/cloudapi/vins/dns_apply.go index 601c916..0629838 100644 --- a/pkg/cloudapi/vins/dns_apply.go +++ b/pkg/cloudapi/vins/dns_apply.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DNSApplyRequest struct to apply new DNS list in VINS diff --git a/pkg/cloudapi/vins/extnet_connect.go b/pkg/cloudapi/vins/extnet_connect.go index b324a61..854ed58 100644 --- a/pkg/cloudapi/vins/extnet_connect.go +++ b/pkg/cloudapi/vins/extnet_connect.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ExtNetConnectRequest struct to connect to external network diff --git a/pkg/cloudapi/vins/extnet_disconnect.go b/pkg/cloudapi/vins/extnet_disconnect.go index 16d67f1..34d60ba 100644 --- a/pkg/cloudapi/vins/extnet_disconnect.go +++ b/pkg/cloudapi/vins/extnet_disconnect.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ExtNetDisconnectRequest struct to disconnect VINS from external network diff --git a/pkg/cloudapi/vins/extnet_list.go b/pkg/cloudapi/vins/extnet_list.go index 9554d75..411ca52 100644 --- a/pkg/cloudapi/vins/extnet_list.go +++ b/pkg/cloudapi/vins/extnet_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ExtNetListRequest struct to get list of VINS external network connections diff --git a/pkg/cloudapi/vins/get.go b/pkg/cloudapi/vins/get.go index dfc887e..419e248 100644 --- a/pkg/cloudapi/vins/get.go +++ b/pkg/cloudapi/vins/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about VINS diff --git a/pkg/cloudapi/vins/ip_list.go b/pkg/cloudapi/vins/ip_list.go index 4252fd3..eb0b243 100644 --- a/pkg/cloudapi/vins/ip_list.go +++ b/pkg/cloudapi/vins/ip_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPListRequest struct for DHCP IP diff --git a/pkg/cloudapi/vins/ip_release.go b/pkg/cloudapi/vins/ip_release.go index 802ce60..27b78e0 100644 --- a/pkg/cloudapi/vins/ip_release.go +++ b/pkg/cloudapi/vins/ip_release.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPReleaseRequest struct for IP release diff --git a/pkg/cloudapi/vins/ip_reserve.go b/pkg/cloudapi/vins/ip_reserve.go index ba63a49..c96681e 100644 --- a/pkg/cloudapi/vins/ip_reserve.go +++ b/pkg/cloudapi/vins/ip_reserve.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPReserveRequest struct for IP reserve diff --git a/pkg/cloudapi/vins/list.go b/pkg/cloudapi/vins/list.go index 9116761..0c4e48e 100644 --- a/pkg/cloudapi/vins/list.go +++ b/pkg/cloudapi/vins/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of VINSes @@ -18,6 +18,10 @@ type ListRequest struct { // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` + // Find by status + // Required: false + Status string `url:"status,omitempty" json:"status,omitempty"` + // Find by account ID // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` diff --git a/pkg/cloudapi/vins/list_deleted.go b/pkg/cloudapi/vins/list_deleted.go index 3b7400a..8cabd62 100644 --- a/pkg/cloudapi/vins/list_deleted.go +++ b/pkg/cloudapi/vins/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted VINSes diff --git a/pkg/cloudapi/vins/nat_rule_add.go b/pkg/cloudapi/vins/nat_rule_add.go index 2c55ff9..4ff8db4 100644 --- a/pkg/cloudapi/vins/nat_rule_add.go +++ b/pkg/cloudapi/vins/nat_rule_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NATRuleAddRequest struct to create NAT rules diff --git a/pkg/cloudapi/vins/nat_rule_del.go b/pkg/cloudapi/vins/nat_rule_del.go index 3b61b0a..75b9829 100644 --- a/pkg/cloudapi/vins/nat_rule_del.go +++ b/pkg/cloudapi/vins/nat_rule_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NATRuleDelRequest struct to delete NAT rule diff --git a/pkg/cloudapi/vins/nat_rule_list.go b/pkg/cloudapi/vins/nat_rule_list.go index 33e4dd5..0593cac 100644 --- a/pkg/cloudapi/vins/nat_rule_list.go +++ b/pkg/cloudapi/vins/nat_rule_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NATRuleListRequest struct to get list of NAT rules diff --git a/pkg/cloudapi/vins/restore.go b/pkg/cloudapi/vins/restore.go index cedbf4a..f4ad926 100644 --- a/pkg/cloudapi/vins/restore.go +++ b/pkg/cloudapi/vins/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct for restore diff --git a/pkg/cloudapi/vins/serialize.go b/pkg/cloudapi/vins/serialize.go index 0817930..472cd51 100644 --- a/pkg/cloudapi/vins/serialize.go +++ b/pkg/cloudapi/vins/serialize.go @@ -3,7 +3,7 @@ package vins import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudapi/vins/static_route_access_grant.go b/pkg/cloudapi/vins/static_route_access_grant.go index 5fd4b84..2ec4c26 100644 --- a/pkg/cloudapi/vins/static_route_access_grant.go +++ b/pkg/cloudapi/vins/static_route_access_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAccessGrantRequest struct to grant access to static route to Compute/ViNS diff --git a/pkg/cloudapi/vins/static_route_access_revoke.go b/pkg/cloudapi/vins/static_route_access_revoke.go index b339f74..80028bd 100644 --- a/pkg/cloudapi/vins/static_route_access_revoke.go +++ b/pkg/cloudapi/vins/static_route_access_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAccessRevokeRequest struct to revoke access to static route to Compute/ViNS diff --git a/pkg/cloudapi/vins/static_route_add.go b/pkg/cloudapi/vins/static_route_add.go index 5367a28..ae21ce9 100644 --- a/pkg/cloudapi/vins/static_route_add.go +++ b/pkg/cloudapi/vins/static_route_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAddRequest struct to add static route diff --git a/pkg/cloudapi/vins/static_route_del.go b/pkg/cloudapi/vins/static_route_del.go index ffb8e02..235835c 100644 --- a/pkg/cloudapi/vins/static_route_del.go +++ b/pkg/cloudapi/vins/static_route_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteDelRequest struct to remove static route from ViNS diff --git a/pkg/cloudapi/vins/static_route_list.go b/pkg/cloudapi/vins/static_route_list.go index 8d69645..95054ae 100644 --- a/pkg/cloudapi/vins/static_route_list.go +++ b/pkg/cloudapi/vins/static_route_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteListRequest struct for static route list diff --git a/pkg/cloudapi/vins/vins.go b/pkg/cloudapi/vins/vins.go index 89c31d6..a60daa0 100644 --- a/pkg/cloudapi/vins/vins.go +++ b/pkg/cloudapi/vins/vins.go @@ -2,7 +2,7 @@ package vins import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to VINS diff --git a/pkg/cloudapi/vins/vnfdev_redeploy.go b/pkg/cloudapi/vins/vnfdev_redeploy.go index 2aca08d..6d3aa64 100644 --- a/pkg/cloudapi/vins/vnfdev_redeploy.go +++ b/pkg/cloudapi/vins/vnfdev_redeploy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // VNFDevRedeployRequest struct for redeploy VNFDevs diff --git a/pkg/cloudapi/vins/vnfdev_restart.go b/pkg/cloudapi/vins/vnfdev_restart.go index 42af5ee..d47f295 100644 --- a/pkg/cloudapi/vins/vnfdev_restart.go +++ b/pkg/cloudapi/vins/vnfdev_restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // VNFDevRestartRequest struct for reboot VINSes primary VNF device diff --git a/pkg/cloudbroker/account.go b/pkg/cloudbroker/account.go index b079e1b..2aab78f 100644 --- a/pkg/cloudbroker/account.go +++ b/pkg/cloudbroker/account.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/account" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/account" ) // Accessing the Account method group diff --git a/pkg/cloudbroker/account/account.go b/pkg/cloudbroker/account/account.go index 5f89f65..17c2304 100644 --- a/pkg/cloudbroker/account/account.go +++ b/pkg/cloudbroker/account/account.go @@ -1,7 +1,7 @@ // API Actor API for managing account package account -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to account type Account struct { diff --git a/pkg/cloudbroker/account/add_user.go b/pkg/cloudbroker/account/add_user.go index 2b27dbd..1f04dca 100644 --- a/pkg/cloudbroker/account/add_user.go +++ b/pkg/cloudbroker/account/add_user.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddUserRequest struct for adding permission to access to account for a user diff --git a/pkg/cloudbroker/account/audits.go b/pkg/cloudbroker/account/audits.go index 4786c49..a38b35b 100644 --- a/pkg/cloudbroker/account/audits.go +++ b/pkg/cloudbroker/account/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to give list of account audits diff --git a/pkg/cloudbroker/account/create.go b/pkg/cloudbroker/account/create.go index 6bbb079..47a8573 100644 --- a/pkg/cloudbroker/account/create.go +++ b/pkg/cloudbroker/account/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct for creating account @@ -14,6 +14,10 @@ type CreateRequest struct { // Required: true Name string `url:"name" json:"name" validate:"required"` + // Description + // Required: false + Description string `url:"desc,omitempty" json:"desc,omitempty"` + // Name of the account // Required: true Username string `url:"username" json:"username" validate:"required"` @@ -56,7 +60,7 @@ type CreateRequest struct { UniqPools []string `url:"uniqPools,omitempty" json:"uniqPools,omitempty"` // Advanced compute features, - // one of: hugepages, numa, cpupin, vfnic + // one of: hugepages, numa, cpupin, vfnic, dpdk, changemac // Required: false ComputeFeatures []string `url:"computeFeatures,omitempty" json:"computeFeatures,omitempty" validate:"omitempty,computeFeatures"` } diff --git a/pkg/cloudbroker/account/delete.go b/pkg/cloudbroker/account/delete.go index 6526788..9305667 100644 --- a/pkg/cloudbroker/account/delete.go +++ b/pkg/cloudbroker/account/delete.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete account @@ -16,6 +16,14 @@ type DeleteRequest struct { // Whether to completely delete the account // Required: false Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"` + + // Name of account + // Required: false + Name string `url:"name,omitempty" json:"name,omitempty"` + + // Reason of deleting + // Required: false + Reason string `url:"reason,omitempty" json:"reason,omitempty"` } // Delete completes delete an account from the system Returns true if account is deleted or was already deleted or never existed diff --git a/pkg/cloudbroker/account/delete_accounts.go b/pkg/cloudbroker/account/delete_accounts.go index 2e07c2f..9ea0703 100644 --- a/pkg/cloudbroker/account/delete_accounts.go +++ b/pkg/cloudbroker/account/delete_accounts.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteAccountsRequest struct to delete group of accounts diff --git a/pkg/cloudbroker/account/delete_user.go b/pkg/cloudbroker/account/delete_user.go index e9b0437..170477a 100644 --- a/pkg/cloudbroker/account/delete_user.go +++ b/pkg/cloudbroker/account/delete_user.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteUserRequest struct to revoke access to account diff --git a/pkg/cloudbroker/account/disable.go b/pkg/cloudbroker/account/disable.go index a8d8848..81365d7 100644 --- a/pkg/cloudbroker/account/disable.go +++ b/pkg/cloudbroker/account/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable account @@ -13,6 +13,10 @@ type DisableRequest struct { // ID of account // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` + + // Reason of disabling + // Required: false + Reason string `url:"reason,omitempty" json:"reason,omitempty"` } // Disable disables an account diff --git a/pkg/cloudbroker/account/disable_accounts.go b/pkg/cloudbroker/account/disable_accounts.go index c80899d..aec3e00 100644 --- a/pkg/cloudbroker/account/disable_accounts.go +++ b/pkg/cloudbroker/account/disable_accounts.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableAccountsRequest struct to disable group of accounts @@ -12,6 +12,10 @@ type DisableAccountsRequest struct { // IDs of accounts // Required: true AccountIDs []uint64 `url:"accountIds" json:"accountIds" validate:"min=1"` + + // Reason of disabling + // Required: false + Reason string `url:"reason,omitempty" json:"reason,omitempty"` } // DisableAccounts disables accounts diff --git a/pkg/cloudbroker/account/enable.go b/pkg/cloudbroker/account/enable.go index 384447b..5d79149 100644 --- a/pkg/cloudbroker/account/enable.go +++ b/pkg/cloudbroker/account/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable account diff --git a/pkg/cloudbroker/account/enable_accounts.go b/pkg/cloudbroker/account/enable_accounts.go index d4bc05f..eec7aef 100644 --- a/pkg/cloudbroker/account/enable_accounts.go +++ b/pkg/cloudbroker/account/enable_accounts.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableAccountsRequest to enable group of accounts diff --git a/pkg/cloudbroker/account/get.go b/pkg/cloudbroker/account/get.go index afe9e7c..9f78251 100644 --- a/pkg/cloudbroker/account/get.go +++ b/pkg/cloudbroker/account/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about account diff --git a/pkg/cloudbroker/account/get_resource_consumption.go b/pkg/cloudbroker/account/get_resource_consumption.go index a526c00..8367f1f 100644 --- a/pkg/cloudbroker/account/get_resource_consumption.go +++ b/pkg/cloudbroker/account/get_resource_consumption.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetResourceConsumptionRequest struct for getting resource consumption diff --git a/pkg/cloudbroker/account/grant_access_templates.go b/pkg/cloudbroker/account/grant_access_templates.go index 43eab1a..231f71d 100644 --- a/pkg/cloudbroker/account/grant_access_templates.go +++ b/pkg/cloudbroker/account/grant_access_templates.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GrantAccessTemplatesRequest struct to share images with account diff --git a/pkg/cloudbroker/account/list.go b/pkg/cloudbroker/account/list.go index 6fb1e5a..b347673 100644 --- a/pkg/cloudbroker/account/list.go +++ b/pkg/cloudbroker/account/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of accounts diff --git a/pkg/cloudbroker/account/list_available_templates.go b/pkg/cloudbroker/account/list_available_templates.go index cd75376..1b50f07 100644 --- a/pkg/cloudbroker/account/list_available_templates.go +++ b/pkg/cloudbroker/account/list_available_templates.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListAvailableTemplatesRequest struct to list templates who sharedWith include accountId diff --git a/pkg/cloudbroker/account/list_computes.go b/pkg/cloudbroker/account/list_computes.go index 12c7da8..e2c28c9 100644 --- a/pkg/cloudbroker/account/list_computes.go +++ b/pkg/cloudbroker/account/list_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListComputesRequest struct to a get list of compute instances diff --git a/pkg/cloudbroker/account/list_deleted.go b/pkg/cloudbroker/account/list_deleted.go index 0b43457..0729004 100644 --- a/pkg/cloudbroker/account/list_deleted.go +++ b/pkg/cloudbroker/account/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted accounts diff --git a/pkg/cloudbroker/account/list_disks.go b/pkg/cloudbroker/account/list_disks.go index 653c841..6b19e19 100644 --- a/pkg/cloudbroker/account/list_disks.go +++ b/pkg/cloudbroker/account/list_disks.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDisksRequest struct to get list of deleted disks diff --git a/pkg/cloudbroker/account/list_flip_groups.go b/pkg/cloudbroker/account/list_flip_groups.go index 20ccb74..d29281b 100644 --- a/pkg/cloudbroker/account/list_flip_groups.go +++ b/pkg/cloudbroker/account/list_flip_groups.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListFLIPGroupsRequest struct to get list of FLIPGroups diff --git a/pkg/cloudbroker/account/list_rg.go b/pkg/cloudbroker/account/list_rg.go index bf58e16..210a06e 100644 --- a/pkg/cloudbroker/account/list_rg.go +++ b/pkg/cloudbroker/account/list_rg.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRGRequest struct to get list of resource groups diff --git a/pkg/cloudbroker/account/list_vins.go b/pkg/cloudbroker/account/list_vins.go index f2f6e6d..48543ac 100644 --- a/pkg/cloudbroker/account/list_vins.go +++ b/pkg/cloudbroker/account/list_vins.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListVINSRequest struct to get list of VINS diff --git a/pkg/cloudbroker/account/models.go b/pkg/cloudbroker/account/models.go index de03ff0..e506d2f 100644 --- a/pkg/cloudbroker/account/models.go +++ b/pkg/cloudbroker/account/models.go @@ -170,6 +170,9 @@ type InfoAccount struct { // Display name DisplayName string `json:"displayname"` + // Description + Description string `json:"desc"` + // GUID GUID uint64 `json:"guid"` @@ -476,6 +479,9 @@ type ItemRG struct { // Deleted time DeletedTime uint64 `json:"deletedTime"` + // Description + Description string `json:"desc"` + // ID ID uint64 `json:"id"` diff --git a/pkg/cloudbroker/account/restore.go b/pkg/cloudbroker/account/restore.go index f6e9a1d..7ff8c25 100644 --- a/pkg/cloudbroker/account/restore.go +++ b/pkg/cloudbroker/account/restore.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore a deleted account @@ -12,6 +12,10 @@ type RestoreRequest struct { // ID an account // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` + + // Reason of disabling + // Required: false + Reason string `url:"reason,omitempty" json:"reason,omitempty"` } // Restore restores a deleted account diff --git a/pkg/cloudbroker/account/revoke_access_templates.go b/pkg/cloudbroker/account/revoke_access_templates.go index b77eabe..dfaa227 100644 --- a/pkg/cloudbroker/account/revoke_access_templates.go +++ b/pkg/cloudbroker/account/revoke_access_templates.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RevokeAccessTemplatesRequest struct to unshare images with account diff --git a/pkg/cloudbroker/account/serialize.go b/pkg/cloudbroker/account/serialize.go index 619a8f6..0c179d2 100644 --- a/pkg/cloudbroker/account/serialize.go +++ b/pkg/cloudbroker/account/serialize.go @@ -3,7 +3,7 @@ package account import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/account/set_cpu_allocation_parameter.go b/pkg/cloudbroker/account/set_cpu_allocation_parameter.go index 6e49704..d6b56f3 100644 --- a/pkg/cloudbroker/account/set_cpu_allocation_parameter.go +++ b/pkg/cloudbroker/account/set_cpu_allocation_parameter.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCPUAllocationParameterRequest struct for setting CPU allocation parameter diff --git a/pkg/cloudbroker/account/set_cpu_allocation_ratio.go b/pkg/cloudbroker/account/set_cpu_allocation_ratio.go index c2d6189..41c7815 100644 --- a/pkg/cloudbroker/account/set_cpu_allocation_ratio.go +++ b/pkg/cloudbroker/account/set_cpu_allocation_ratio.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCPUAllocationRatioRequest struct for setting CPU allocation ratio diff --git a/pkg/cloudbroker/account/update.go b/pkg/cloudbroker/account/update.go index 3e5606c..cacc490 100644 --- a/pkg/cloudbroker/account/update.go +++ b/pkg/cloudbroker/account/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update account @@ -14,6 +14,10 @@ type UpdateRequest struct { // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` + // Description + // Required: false + Description string `url:"desc,omitempty" json:"desc,omitempty"` + // Name of the account // Required: false Name string `url:"name" json:"name"` diff --git a/pkg/cloudbroker/account/update_compute_features.go b/pkg/cloudbroker/account/update_compute_features.go index 7176cbd..76078b4 100644 --- a/pkg/cloudbroker/account/update_compute_features.go +++ b/pkg/cloudbroker/account/update_compute_features.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateComputeFeaturesRequest struct to update advanced compute features @@ -15,7 +15,7 @@ type UpdateComputeFeaturesRequest struct { AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` // Advanced compute features, - // one of: hugepages, numa, cpupin, vfnic + // one of: hugepages, numa, cpupin, vfnic, dpdk, changemac // Required: false ComputeFeatures []string `url:"computeFeatures,omitempty" json:"computeFeatures,omitempty" validate:"omitempty,computeFeatures"` } diff --git a/pkg/cloudbroker/account/update_resource_types.go b/pkg/cloudbroker/account/update_resource_types.go index 3ec22b8..611c737 100644 --- a/pkg/cloudbroker/account/update_resource_types.go +++ b/pkg/cloudbroker/account/update_resource_types.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateResourceTypesRequest struct to update resource types in account diff --git a/pkg/cloudbroker/account/update_user.go b/pkg/cloudbroker/account/update_user.go index 367f175..3240e1f 100644 --- a/pkg/cloudbroker/account/update_user.go +++ b/pkg/cloudbroker/account/update_user.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateUserRequest struct to update user access rights diff --git a/pkg/cloudbroker/apiaccess.go b/pkg/cloudbroker/apiaccess.go index 218e145..d40c83b 100644 --- a/pkg/cloudbroker/apiaccess.go +++ b/pkg/cloudbroker/apiaccess.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/apiaccess" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/apiaccess" // Accessing the APIAccess method group func (cb *CloudBroker) APIAccess() *apiaccess.APIAccess { diff --git a/pkg/cloudbroker/apiaccess/api_find.go b/pkg/cloudbroker/apiaccess/api_find.go index 31e7db3..6c52c21 100644 --- a/pkg/cloudbroker/apiaccess/api_find.go +++ b/pkg/cloudbroker/apiaccess/api_find.go @@ -5,15 +5,23 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // APIFindRequest struct for finding apiaccess groups. type APIFindRequest struct { - // API function to find - // Example: cloudbroker/k8s/create - // Required: true - APIName string `url:"apiName" json:"apiName" validate:"required"` + //API group to find (cloudbroker, cloudapi, etc) + //Available values : cloudapi, cloudbroker, system + //Required: true + APIGroup string `url:"api_group" json:"api_group" validate:"required,apiGroup"` + + //API object to find (compute, vins, etc ) + //Required: true + APIObject string `url:"api_object" json:"api_object" validate:"required"` + + //API endpoint to find (delete, create, etc) + //Required: true + APIMethod string `url:"api_method" json:"api_method" validate:"required"` } // APIFind outputs a list of apiaccess groups that mention the specified API function. diff --git a/pkg/cloudbroker/apiaccess/apiaccess.go b/pkg/cloudbroker/apiaccess/apiaccess.go index ca38fec..3aff618 100644 --- a/pkg/cloudbroker/apiaccess/apiaccess.go +++ b/pkg/cloudbroker/apiaccess/apiaccess.go @@ -1,6 +1,6 @@ package apiaccess -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to APIAccess type APIAccess struct { diff --git a/pkg/cloudbroker/apiaccess/apis_exclude.go b/pkg/cloudbroker/apiaccess/apis_exclude.go index bac104b..d976e12 100644 --- a/pkg/cloudbroker/apiaccess/apis_exclude.go +++ b/pkg/cloudbroker/apiaccess/apis_exclude.go @@ -6,7 +6,7 @@ import ( "fmt" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type APIString string @@ -15,7 +15,7 @@ type APIString string type APIsExcludeRequest struct { // APIAccess group ID // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` // APIs to remove from APIAccess group // Required: true diff --git a/pkg/cloudbroker/apiaccess/apis_include.go b/pkg/cloudbroker/apiaccess/apis_include.go index c5450f4..e804ff3 100644 --- a/pkg/cloudbroker/apiaccess/apis_include.go +++ b/pkg/cloudbroker/apiaccess/apis_include.go @@ -5,14 +5,14 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // APIsIncludeRequest struct for adding api to access group. type APIsIncludeRequest struct { // APIAccess group ID. // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` // APIs to add to APIAccess group. // Required: true diff --git a/pkg/cloudbroker/apiaccess/copy.go b/pkg/cloudbroker/apiaccess/copy.go index 79c50bf..2eb8375 100644 --- a/pkg/cloudbroker/apiaccess/copy.go +++ b/pkg/cloudbroker/apiaccess/copy.go @@ -5,14 +5,14 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CopyRequest Request for copying apiaccess group. type CopyRequest struct { // ID of the API access group to make copy from // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` // Name of the target API access group, which will be created on successful copy // Required: true diff --git a/pkg/cloudbroker/apiaccess/create.go b/pkg/cloudbroker/apiaccess/create.go index 56148ad..dd8c8f3 100644 --- a/pkg/cloudbroker/apiaccess/create.go +++ b/pkg/cloudbroker/apiaccess/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct for creating apiaccess group. diff --git a/pkg/cloudbroker/apiaccess/delete.go b/pkg/cloudbroker/apiaccess/delete.go index 98097d9..e5c3d6a 100644 --- a/pkg/cloudbroker/apiaccess/delete.go +++ b/pkg/cloudbroker/apiaccess/delete.go @@ -5,14 +5,14 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct for deleting apiaccess group. type DeleteRequest struct { // APIAccess group ID. // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` // Set True to delete apiaccess group with attached users. // Required: false diff --git a/pkg/cloudbroker/apiaccess/desc_update.go b/pkg/cloudbroker/apiaccess/desc_update.go index b7b74cd..2988704 100644 --- a/pkg/cloudbroker/apiaccess/desc_update.go +++ b/pkg/cloudbroker/apiaccess/desc_update.go @@ -5,14 +5,14 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DescUpdateRequest struct for updating apiaccess group description. type DescUpdateRequest struct { // APIAccess group ID. // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` // New description to set for the apiaccess group. // Required: true diff --git a/pkg/cloudbroker/apiaccess/get.go b/pkg/cloudbroker/apiaccess/get.go index df2c4ae..4cec279 100644 --- a/pkg/cloudbroker/apiaccess/get.go +++ b/pkg/cloudbroker/apiaccess/get.go @@ -5,14 +5,14 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get apiaccess group. type GetRequest struct { // APIAccess group ID. // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` } // Get gets apiaccess group as an ItemAPIAccess struct diff --git a/pkg/cloudbroker/apiaccess/get_pre_groups.go b/pkg/cloudbroker/apiaccess/get_default.go similarity index 50% rename from pkg/cloudbroker/apiaccess/get_pre_groups.go rename to pkg/cloudbroker/apiaccess/get_default.go index 0315f4d..88254cd 100644 --- a/pkg/cloudbroker/apiaccess/get_pre_groups.go +++ b/pkg/cloudbroker/apiaccess/get_default.go @@ -6,11 +6,11 @@ import ( "net/http" ) -// GetPreGroups gets list of pre default groups from spec -func (a APIAccess) GetPreGroups(ctx context.Context) (map[string]APIsEndpoints, error) { - url := "/cloudbroker/apiaccess/getPreGroups" +// GetDefault gets default apiaccess group +func (a APIAccess) GetDefault(ctx context.Context) (*ItemAPIAccessDefault, error) { + url := "/cloudbroker/apiaccess/getDefault" - info := make(map[string]APIsEndpoints) + info := ItemAPIAccessDefault{} res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, nil) if err != nil { @@ -22,5 +22,5 @@ func (a APIAccess) GetPreGroups(ctx context.Context) (map[string]APIsEndpoints, return nil, err } - return info, nil + return &info, nil } diff --git a/pkg/cloudbroker/apiaccess/list.go b/pkg/cloudbroker/apiaccess/list.go index 513d6be..54d96bf 100644 --- a/pkg/cloudbroker/apiaccess/list.go +++ b/pkg/cloudbroker/apiaccess/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of all non deleted apiaccess instances. @@ -22,21 +22,21 @@ type ListRequest struct { // Required: false Status string `url:"status,omitempty" json:"status,omitempty"` - // Find by created actor + // Find by description // Required: false - CreatedBy string `url:"createdBy,omitempty" json:"createdBy,omitempty"` + Desc string `url:"desc,omitempty" json:"desc,omitempty"` // Find by created after time (unix timestamp) // Required: false - CreatedAfter uint64 `url:"createdAfter,omitempty" json:"createdAfter,omitempty"` + CreatedAfter uint64 `url:"created_after,omitempty" json:"created_after,omitempty"` // Find by created before time (unix timestamp) // Required: false - CreatedBefore uint64 `url:"createdBefore,omitempty" json:"createdBefore,omitempty"` + CreatedBefore uint64 `url:"created_before,omitempty" json:"created_before,omitempty"` // Sort by one of supported fields, format +|-(field) // Required: false - SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` + SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"` // Page number // Required: false diff --git a/pkg/cloudbroker/apiaccess/list_deleted.go b/pkg/cloudbroker/apiaccess/list_deleted.go deleted file mode 100644 index 57d2ae1..0000000 --- a/pkg/cloudbroker/apiaccess/list_deleted.go +++ /dev/null @@ -1,48 +0,0 @@ -package apiaccess - -import ( - "context" - "encoding/json" - "net/http" - - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" -) - -// ListDeletedRequest struct for getting list of all deleted apiaccess instances. -type ListDeletedRequest struct { - // Sort by one of supported fields, format +|-(field) - // Required: false - SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` - - // Page number. - // Required: false - Page uint64 `url:"page,omitempty" json:"page,omitempty"` - - // Page size. - // Required: false - Size uint64 `url:"size,omitempty" json:"size,omitempty"` -} - -// ListDeleted gets list of all deleted apiaccess instances. -func (a APIAccess) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListAPIAccess, error) { - - if err := validators.ValidateRequest(req); err != nil { - return nil, validators.ValidationErrors(validators.GetErrors(err)) - } - - url := "/cloudbroker/apiaccess/listDeleted" - - info := ListAPIAccess{} - - res, err := a.client.DecortApiCall(ctx, http.MethodPost, url, req) - if err != nil { - return nil, err - } - - err = json.Unmarshal(res, &info) - if err != nil { - return nil, err - } - - return &info, nil -} diff --git a/pkg/cloudbroker/apiaccess/models.go b/pkg/cloudbroker/apiaccess/models.go index 82b23da..4814f1e 100644 --- a/pkg/cloudbroker/apiaccess/models.go +++ b/pkg/cloudbroker/apiaccess/models.go @@ -4,23 +4,16 @@ type ItemAPIAccess struct { // APIs APIs APIsEndpoints `json:"apis"` - // Created by - CreatedBy string `json:"createdBy"` - - // Created time - CreatedTime uint64 `json:"createdTime"` + CreatedTime uint64 `json:"created_at"` // Is default Default bool `json:"default"` - // Deleted by - DeletedBy string `json:"deletedBy"` - // Deleted time - DeletedTime uint64 `json:"deletedTime"` + DeletedTime uint64 `json:"deleted_at"` // Description - Description string `json:"decs"` + Description string `json:"desc"` // GID GID uint64 `json:"gid"` @@ -31,9 +24,6 @@ type ItemAPIAccess struct { // ID ID uint64 `json:"id"` - // Milestones - Milestones uint64 `json:"milestones"` - // Name Name string `json:"name"` @@ -43,11 +33,46 @@ type ItemAPIAccess struct { // Status Status string `json:"status"` - //Updated by - UpdatedBy string `json:"updatedBy"` - // Updated time - UpdatedTime uint64 `json:"updatedTime"` + UpdatedTime uint64 `json:"updated_at"` +} + +type ItemAPIAccessDefault struct { + // APIs + APIs APIsEndpoints `json:"apis"` + + // Created at + CreatedAt uint64 `json:"created_at"` + + // Is default + Default bool `json:"default"` + + // Deleted at + DeletedAt uint64 `json:"deleted_at"` + + // Description + Description string `json:"decs"` + + // GID + GID uint64 `json:"gid"` + + // GUID + GUID uint64 `json:"guid"` + + // ID + ID uint64 `json:"id"` + + // Name + Name string `json:"name"` + + // Protected + Protected bool `json:"protected"` + + // Status + Status string `json:"status"` + + //Updated at + UpdatedAt uint64 `json:"updated_at"` } type ListAPIAccess struct { @@ -77,6 +102,7 @@ type CloudAPIEndpoints struct { Compute []string `json:"compute,omitempty"` ComputeCI []string `json:"computeci,omitempty"` Disks []string `json:"disks,omitempty"` + DPDK []string `json:"dpdk,omitempty"` ExtNet []string `json:"extnet,omitempty"` FLIPGroup []string `json:"flipgroup,omitempty"` GPU []string `json:"gpu,omitempty"` @@ -115,6 +141,7 @@ type CloudBrokerEndpoints struct { Desnode []string `json:"desnode,omitempty"` Diagnostics []string `json:"diagnostics,omitempty"` Disks []string `json:"disks,omitempty"` + DPDK []string `json:"dpdk,omitempty"` Eco []string `json:"eco,omitempty"` ExtNet []string `json:"extnet,omitempty"` FlIPgroup []string `json:"flipgroup,omitempty"` diff --git a/pkg/cloudbroker/apiaccess/set_default.go b/pkg/cloudbroker/apiaccess/set_default.go index fe336d0..2034432 100644 --- a/pkg/cloudbroker/apiaccess/set_default.go +++ b/pkg/cloudbroker/apiaccess/set_default.go @@ -5,14 +5,14 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetDefaultRequest struct for setting default apiaccess group. type SetDefaultRequest struct { // APIAccess group ID // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` } // SetDefault sets current apiaccess group default. diff --git a/pkg/cloudbroker/apiaccess/subtract.go b/pkg/cloudbroker/apiaccess/subtract.go index bf74042..9c8c68b 100644 --- a/pkg/cloudbroker/apiaccess/subtract.go +++ b/pkg/cloudbroker/apiaccess/subtract.go @@ -6,16 +6,16 @@ import ( "context" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SubtractRequest struct for subtracting. type SubtractRequest struct { // ID of the API access group to subtract from. This group will contain the difference. - MinuendID uint64 `url:"minuendId" json:"minuendId" validate:"required"` + MinuendID uint64 `url:"minuend_group_id" json:"minuend_group_id" validate:"required"` // ID of the API access group which is subtracted. This group is unchanged. - SubtrahendID uint64 `url:"subtrahendId" json:"subtrahendId" validate:"required"` + SubtrahendID uint64 `url:"subtrahend_group_id" json:"subtrahend_group_id" validate:"required"` } // Subtract removes such APIs from MinuendID that match APIs from SubtrahendID. diff --git a/pkg/cloudbroker/apiaccess/union.go b/pkg/cloudbroker/apiaccess/union.go index 1b4b949..e03b1df 100644 --- a/pkg/cloudbroker/apiaccess/union.go +++ b/pkg/cloudbroker/apiaccess/union.go @@ -5,18 +5,18 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UnionRequest struct for union. type UnionRequest struct { // Recipient apiaccess group ID // Required: true - RecipientID uint64 `url:"recipientId" json:"recipientId" validate:"required"` + RecipientID uint64 `url:"recipient_group_id" json:"recipient_group_id" validate:"required"` // Donor apiaccess group ID // Required: true - DonorID uint64 `url:"donorId" json:"donorId" validate:"required"` + DonorID uint64 `url:"donor_group_id" json:"donor_group_id" validate:"required"` } // Union combines the API list of group #1 ("recipient") and group #2 ("donor"), diff --git a/pkg/cloudbroker/apiaccess/update.go b/pkg/cloudbroker/apiaccess/update.go index 893dbbd..7a1388d 100644 --- a/pkg/cloudbroker/apiaccess/update.go +++ b/pkg/cloudbroker/apiaccess/update.go @@ -6,14 +6,14 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct for updating apis of apiaccess group. type UpdateRequest struct { // APIAccess group ID // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` // APIs to remove from APIAccess group // Required: false diff --git a/pkg/cloudbroker/apiaccess/user_list.go b/pkg/cloudbroker/apiaccess/user_list.go index 9cc0d06..c90c326 100644 --- a/pkg/cloudbroker/apiaccess/user_list.go +++ b/pkg/cloudbroker/apiaccess/user_list.go @@ -5,14 +5,14 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserListRequest struct for getting a list of users currently included in the specified group. type UserListRequest struct { // APIAccess group ID // Required: true - APIAccessID uint64 `url:"apiaccessId" json:"apiaccessId" validate:"required"` + APIAccessID uint64 `url:"apiaccess_id" json:"apiaccess_id" validate:"required"` // Page number // Required: false diff --git a/pkg/cloudbroker/audit.go b/pkg/cloudbroker/audit.go index 94685fc..4f208a2 100644 --- a/pkg/cloudbroker/audit.go +++ b/pkg/cloudbroker/audit.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/audit" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/audit" ) // Accessing the Stack method group diff --git a/pkg/cloudbroker/audit/audit.go b/pkg/cloudbroker/audit/audit.go index c099d42..b2647e8 100644 --- a/pkg/cloudbroker/audit/audit.go +++ b/pkg/cloudbroker/audit/audit.go @@ -1,6 +1,6 @@ package audit -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to audit type Audit struct { diff --git a/pkg/cloudbroker/audit/get.go b/pkg/cloudbroker/audit/get.go index 9e58298..19c2850 100644 --- a/pkg/cloudbroker/audit/get.go +++ b/pkg/cloudbroker/audit/get.go @@ -5,14 +5,14 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about account type GetRequest struct { // Audit GUID // Required: true - AuditGuid string `url:"auditGuid" json:"auditGuid" validate:"required"` + AuditGuid string `url:"audit_guid" json:"audit_guid" validate:"required"` } // Get gets information about audit as a RecordAudit struct diff --git a/pkg/cloudbroker/audit/linked_jobs.go b/pkg/cloudbroker/audit/linked_jobs.go index a6142cf..174cfc4 100644 --- a/pkg/cloudbroker/audit/linked_jobs.go +++ b/pkg/cloudbroker/audit/linked_jobs.go @@ -5,14 +5,14 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // LinkedJobsRequest struct to get information about jobs linked with Audit type LinkedJobsRequest struct { // Audit GUID // Required: true - AuditGuid string `url:"auditGuid" json:"auditGuid" validate:"required"` + AuditGuid string `url:"audit_guid" json:"audit_guid" validate:"required"` } // LinkedJobs gets information about Linked Jobs as a ListLinkedJobs struct diff --git a/pkg/cloudbroker/audit/list.go b/pkg/cloudbroker/audit/list.go index e3b116c..2b23c69 100644 --- a/pkg/cloudbroker/audit/list.go +++ b/pkg/cloudbroker/audit/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to give list of account audits @@ -13,11 +13,11 @@ type ListRequest struct { // Find all audits after point in time (unixtime) // Required: false - TimestampAt uint64 `url:"timestampAt,omitempty" json:"timestampAt,omitempty"` + TimestampAt uint64 `url:"timestamp_at,omitempty" json:"timestamp_at,omitempty"` // Find all audits before point in time (unixtime) // Required: false - TimestampTo uint64 `url:"timestampTo,omitempty" json:"timestampTo,omitempty"` + TimestampTo uint64 `url:"timestamp_to,omitempty" json:"timestamp_to,omitempty"` // Find by user (Mongo RegExp supported) // Required: false @@ -27,17 +27,21 @@ type ListRequest struct { // Required: false Call string `url:"call,omitempty" json:"call,omitempty"` + // Find by request id + // Required: false + RequestID string `url:"request_id,omitempty" json:"request_id,omitempty"` + // Find by HTTP min status code // Required: false - MinStatusCode uint64 `url:"minStatusCode,omitempty" json:"minStatusCode,omitempty"` + MinStatusCode uint64 `url:"min_status_code,omitempty" json:"min_status_code,omitempty"` // Find by HTTP max status code // Required: false - MaxStatusCode uint64 `url:"maxStatusCode,omitempty" json:"maxStatusCode,omitempty"` + MaxStatusCode uint64 `url:"max_status_code,omitempty" json:"max_status_code,omitempty"` // Sort by one of supported fields, format +|-(field) // Required: false - SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` + SortBy string `url:"sort_by,omitempty" json:"sort_by,omitempty" validate:"omitempty,sortBy"` // Page number // Required: false diff --git a/pkg/cloudbroker/audit/models.go b/pkg/cloudbroker/audit/models.go index adf0885..ef9599b 100644 --- a/pkg/cloudbroker/audit/models.go +++ b/pkg/cloudbroker/audit/models.go @@ -2,23 +2,44 @@ package audit // Main info about audit type ItemAudit struct { + // Args + Args string `json:"args"` + // Call Call string `json:"call"` // GUID GUID string `json:"guid"` + // Kwargs + Kwargs string `json:"kwargs"` + + // RemoteAddr + RemoteAddr string `json:"remote_addr"` + // Response time ResponseTime float64 `json:"responsetime"` + // Result + Result string `json:"result"` + // Status code StatusCode uint64 `json:"statuscode"` // Timestamp Timestamp float64 `json:"timestamp"` + // Timestamp End + TimestampEnd float64 `json:"timestampEnd"` + // User User string `json:"user"` + + // TTL + TTL string `json:"_ttl"` + + // Tags + Tags string `json:"tags"` } // List of audits @@ -68,6 +89,9 @@ type RecordAudit struct { // User User string `json:"user"` + + // TTL + TTL string `json:"_ttl"` } // List of Linked Jobs @@ -85,6 +109,9 @@ type ItemLinkedJobs struct { // NID NID uint64 `json:"nid"` + // Physical Node or not + PhysicalNode bool `json:"physicalNode"` + // state State string `json:"state"` diff --git a/pkg/cloudbroker/backup.go b/pkg/cloudbroker/backup.go index 93dab64..7300f68 100644 --- a/pkg/cloudbroker/backup.go +++ b/pkg/cloudbroker/backup.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/backup" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/backup" // Accessing the Backup method group func (cb *CloudBroker) Backup() *backup.Backup { diff --git a/pkg/cloudbroker/backup/backup.go b/pkg/cloudbroker/backup/backup.go index aa7c96b..6bc7339 100644 --- a/pkg/cloudbroker/backup/backup.go +++ b/pkg/cloudbroker/backup/backup.go @@ -1,7 +1,7 @@ package backup import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to backup diff --git a/pkg/cloudbroker/backup/create_disk_backup.go b/pkg/cloudbroker/backup/create_disk_backup.go index b3afe2f..cc429b0 100644 --- a/pkg/cloudbroker/backup/create_disk_backup.go +++ b/pkg/cloudbroker/backup/create_disk_backup.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateDiskBackupRequest struct for creating disk backup diff --git a/pkg/cloudbroker/backup/create_disks_backup.go b/pkg/cloudbroker/backup/create_disks_backup.go index c1ac286..c2ec398 100644 --- a/pkg/cloudbroker/backup/create_disks_backup.go +++ b/pkg/cloudbroker/backup/create_disks_backup.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type Disk struct { diff --git a/pkg/cloudbroker/backup/delete_disk_backup.go b/pkg/cloudbroker/backup/delete_disk_backup.go index e2ece58..a3d34a7 100644 --- a/pkg/cloudbroker/backup/delete_disk_backup.go +++ b/pkg/cloudbroker/backup/delete_disk_backup.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteDiskBackupRequest struct for deleting disk backup diff --git a/pkg/cloudbroker/backup/list_backup_paths.go b/pkg/cloudbroker/backup/list_backup_paths.go index e2b7fcc..3d04ac7 100644 --- a/pkg/cloudbroker/backup/list_backup_paths.go +++ b/pkg/cloudbroker/backup/list_backup_paths.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListBackupPathsRequest struct for getting list of backup paths diff --git a/pkg/cloudbroker/backup/restore_disk_from_backup.go b/pkg/cloudbroker/backup/restore_disk_from_backup.go index c8fdcee..ba6cca2 100644 --- a/pkg/cloudbroker/backup/restore_disk_from_backup.go +++ b/pkg/cloudbroker/backup/restore_disk_from_backup.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreDiskFromBackupRequest struct for restoring disk from backup diff --git a/pkg/cloudbroker/backup/restore_disks_from_backup.go b/pkg/cloudbroker/backup/restore_disks_from_backup.go index a22f79e..d8ecfc6 100644 --- a/pkg/cloudbroker/backup/restore_disks_from_backup.go +++ b/pkg/cloudbroker/backup/restore_disks_from_backup.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type BackupFile struct { diff --git a/pkg/cloudbroker/bservice.go b/pkg/cloudbroker/bservice.go new file mode 100644 index 0000000..64f1592 --- /dev/null +++ b/pkg/cloudbroker/bservice.go @@ -0,0 +1,8 @@ +package cloudbroker + +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/bservice" + +// Accessing the BService method group +func (ca *CloudBroker) BService() *bservice.BService { + return bservice.New(ca.client) +} diff --git a/pkg/cloudbroker/bservice/bservice.go b/pkg/cloudbroker/bservice/bservice.go new file mode 100644 index 0000000..c66b3a4 --- /dev/null +++ b/pkg/cloudbroker/bservice/bservice.go @@ -0,0 +1,15 @@ +package bservice + +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + +// Structure for creating request to bservice +type BService struct { + client interfaces.Caller +} + +// Builder for bservice endpoints +func New(client interfaces.Caller) *BService { + return &BService{ + client, + } +} diff --git a/pkg/cloudbroker/bservice/create.go b/pkg/cloudbroker/bservice/create.go new file mode 100644 index 0000000..65b797a --- /dev/null +++ b/pkg/cloudbroker/bservice/create.go @@ -0,0 +1,50 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// CreateRequest struct for BasicService +type CreateRequest struct { + // Name of the service + // Required: true + Name string `url:"name" json:"name" validate:"required"` + + // ID of the Resource Group where this service will be placed + // Required: true + RGID uint64 `url:"rgId" json:"rgId" validate:"required"` + + // Name of the user to deploy SSH key for. Pass empty string if no SSH key deployment is required + // Required: false + SSHUser string `url:"sshUser,omitempty" json:"sshUser,omitempty"` + + // SSH key to deploy for the specified user. Same key will be deployed to all computes of the service + // Required: false + SSHKey string `url:"sshKey,omitempty" json:"sshKey,omitempty"` +} + +// Create creates blank BasicService instance +func (b BService) Create(ctx context.Context, req CreateRequest) (uint64, error) { + err := validators.ValidateRequest(req) + if err != nil { + return 0, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/create" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return 0, err + } + + result, err := strconv.ParseUint(string(res), 10, 64) + if err != nil { + return 0, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/delete.go b/pkg/cloudbroker/bservice/delete.go new file mode 100644 index 0000000..3c8267f --- /dev/null +++ b/pkg/cloudbroker/bservice/delete.go @@ -0,0 +1,42 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// DeleteRequest struct to delete basic service +type DeleteRequest struct { + // ID of the BasicService to be delete + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // If set to False, Basic service will be deleted to recycle bin. Otherwise destroyed immediately + // Required: true + Permanently bool `url:"permanently" json:"permanently"` +} + +// Delete deletes BasicService instance +func (b BService) Delete(ctx context.Context, req DeleteRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/delete" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/disable.go b/pkg/cloudbroker/bservice/disable.go new file mode 100644 index 0000000..1816793 --- /dev/null +++ b/pkg/cloudbroker/bservice/disable.go @@ -0,0 +1,40 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// DisableRequest struct for disable service +type DisableRequest struct { + // ID of the service to disable + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` +} + +// Disable disables service. +// Disabling a service technically means setting model status +// of all computes and service itself to DISABLED and stopping all computes. +func (b BService) Disable(ctx context.Context, req DisableRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/disable" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/enable.go b/pkg/cloudbroker/bservice/enable.go new file mode 100644 index 0000000..a297993 --- /dev/null +++ b/pkg/cloudbroker/bservice/enable.go @@ -0,0 +1,41 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// EnableRequest struct to disable service +type EnableRequest struct { + // ID of the service to enable + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` +} + +// Enable enables service. +// Enabling a service technically means setting model status of +// all computes and service itself to ENABLED. +// It does not start computes. +func (b BService) Enable(ctx context.Context, req EnableRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/enable" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/filter.go b/pkg/cloudbroker/bservice/filter.go new file mode 100644 index 0000000..f503212 --- /dev/null +++ b/pkg/cloudbroker/bservice/filter.go @@ -0,0 +1,71 @@ +package bservice + +// FilterByID returns ListBasicServices with specified ID. +func (lbs ListBasicServices) FilterByID(id uint64) ListBasicServices { + predicate := func(ibs ItemBasicService) bool { + return ibs.ID == id + } + + return lbs.FilterFunc(predicate) +} + +// FilterByName returns ListBasicServices with specified Name. +func (lbs ListBasicServices) FilterByName(name string) ListBasicServices { + predicate := func(ibs ItemBasicService) bool { + return ibs.Name == name + } + + return lbs.FilterFunc(predicate) +} + +// FilterByRGID returns ListBasicServices with specified RGID. +func (lbs ListBasicServices) FilterByRGID(rgID uint64) ListBasicServices { + predicate := func(ibs ItemBasicService) bool { + return ibs.RGID == rgID + } + + return lbs.FilterFunc(predicate) +} + +// FilterByStatus returns ListBasicServices with specified Status. +func (lbs ListBasicServices) FilterByStatus(status string) ListBasicServices { + predicate := func(ibs ItemBasicService) bool { + return ibs.Status == status + } + + return lbs.FilterFunc(predicate) +} + +// FilterByTechStatus returns ListBasicServices with specified TechStatus. +func (lbs ListBasicServices) FilterByTechStatus(techStatus string) ListBasicServices { + predicate := func(ibs ItemBasicService) bool { + return ibs.TechStatus == techStatus + } + + return lbs.FilterFunc(predicate) +} + +// FilterFunc allows filtering ListResourceGroups based on a user-specified predicate. +func (lbs ListBasicServices) FilterFunc(predicate func(ItemBasicService) bool) ListBasicServices { + var result ListBasicServices + + for _, item := range lbs.Data { + if predicate(item) { + result.Data = append(result.Data, item) + } + } + + result.EntryCount = uint64(len(lbs.Data)) + + return result +} + +// FindOne returns first found ItemBasicService +// If none was found, returns an empty struct. +func (lbs ListBasicServices) FindOne() ItemBasicService { + if lbs.EntryCount == 0 { + return ItemBasicService{} + } + + return lbs.Data[0] +} diff --git a/pkg/cloudbroker/bservice/filter_test.go b/pkg/cloudbroker/bservice/filter_test.go new file mode 100644 index 0000000..70e2949 --- /dev/null +++ b/pkg/cloudbroker/bservice/filter_test.go @@ -0,0 +1,155 @@ +package bservice + +import "testing" + +var bservices = ListBasicServices{ + Data: []ItemBasicService{ + { + AccountID: 1, + AccountName: "std_1", + BaseDomain: "", + CreatedBy: "sample_user_1@decs3o", + CreatedTime: 1677743675, + DeletedBy: "", + DeletedTime: 0, + GID: 212, + Groups: []uint64{}, + GUID: 1, + ID: 1, + Name: "bservice_1", + ParentSrvID: 0, + ParentSrvType: "", + RGID: 7971, + RGName: "rg_1", + SSHUser: "", + Status: "CREATED", + TechStatus: "STOPPED", + UpdatedBy: "", + UpdatedTime: 0, + UserManaged: true, + }, + { + AccountID: 2, + AccountName: "std_2", + BaseDomain: "", + CreatedBy: "sample_user_1@decs3o", + CreatedTime: 1677743736, + DeletedBy: "", + DeletedTime: 0, + GID: 212, + Groups: []uint64{}, + GUID: 2, + ID: 2, + Name: "bservice_2", + ParentSrvID: 0, + ParentSrvType: "", + RGID: 7972, + RGName: "rg_2", + SSHUser: "", + Status: "CREATED", + TechStatus: "STOPPED", + UpdatedBy: "", + UpdatedTime: 0, + UserManaged: true, + }, + { + AccountID: 3, + AccountName: "std_3", + BaseDomain: "", + CreatedBy: "sample_user_2@decs3o", + CreatedTime: 1677743830, + DeletedBy: "", + DeletedTime: 0, + GID: 212, + Groups: []uint64{}, + GUID: 3, + ID: 3, + Name: "bservice_3", + ParentSrvID: 0, + ParentSrvType: "", + RGID: 7973, + RGName: "rg_3", + SSHUser: "", + Status: "ENABLED", + TechStatus: "STARTED", + UpdatedBy: "", + UpdatedTime: 0, + UserManaged: true, + }, + }, + EntryCount: 3, +} + +func TestFilterByID(t *testing.T) { + actual := bservices.FilterByID(1).FindOne() + + if actual.ID != 1 { + t.Fatal("expected ID 1, found: ", actual.ID) + } +} + +func TestFilterByName(t *testing.T) { + actual := bservices.FilterByName("bservice_3").FindOne() + + if actual.Name != "bservice_3" { + t.Fatal("expected Name 'bservice_3', found: ", actual.Name) + } +} + +func TestFilterByRGID(t *testing.T) { + actual := bservices.FilterByRGID(7971).FindOne() + + if actual.RGID != 7971 { + t.Fatal("expected RGID 7971, found: ", actual.RGID) + } +} + +func TestFilterByStatus(t *testing.T) { + actual := bservices.FilterByStatus("CREATED") + + if len(actual.Data) != 2 { + t.Fatal("expected 2 found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + if item.Status != "CREATED" { + t.Fatal("expected Status 'CREATED', found: ", item.Status) + } + } +} + +func TestFilterByTechStatus(t *testing.T) { + actual := bservices.FilterByTechStatus("STOPPED") + + if len(actual.Data) != 2 { + t.Fatal("expected 2 found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + if item.TechStatus != "STOPPED" { + t.Fatal("expected TechStatus 'STOPPED', found: ", item.TechStatus) + } + } +} + +func TestFilterFunc(t *testing.T) { + actual := bservices.FilterFunc(func(ibs ItemBasicService) bool { + return ibs.CreatedBy == "sample_user_2@decs3o" + }) + + if len(actual.Data) > 1 { + t.Fatal("expected 1 found, actual: ", len(actual.Data)) + } + + if actual.FindOne().CreatedBy != "sample_user_2@decs3o" { + t.Fatal("expected 'sample_user_2@decs3o', found: ", actual.FindOne().CreatedBy) + } +} + +func TestSortByCreatedTime(t *testing.T) { + actual := bservices.SortByCreatedTime(true) + + if actual.Data[0].CreatedTime != 1677743830 || actual.Data[2].CreatedTime != 1677743675 { + t.Fatal("expected descending order, found ascending") + } +} diff --git a/pkg/cloudbroker/bservice/get.go b/pkg/cloudbroker/bservice/get.go new file mode 100644 index 0000000..186184f --- /dev/null +++ b/pkg/cloudbroker/bservice/get.go @@ -0,0 +1,46 @@ +package bservice + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GetRequest struct to get detailed information about service +type GetRequest struct { + // ID of the service to query information + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` +} + +// Get gets detailed specifications for the BasicService as a RecordBasicService struct +func (b BService) Get(ctx context.Context, req GetRequest) (*RecordBasicService, error) { + res, err := b.GetRaw(ctx, req) + if err != nil { + return nil, err + } + + info := RecordBasicService{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets detailed specifications for the BasicService as an array of bytes +func (b BService) GetRaw(ctx context.Context, req GetRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/get" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudbroker/bservice/group_add.go b/pkg/cloudbroker/bservice/group_add.go new file mode 100644 index 0000000..10de6df --- /dev/null +++ b/pkg/cloudbroker/bservice/group_add.go @@ -0,0 +1,112 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupAddRequest struct to create new compute group within BasicService +type GroupAddRequest struct { + // ID of the Basic Service to add a group to + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // Name of the Compute Group to add + // Required: true + Name string `url:"name" json:"name" validate:"required"` + + // Computes number. Defines how many computes must be there in the group + // Required: true + Count uint64 `url:"count" json:"count" validate:"required"` + + // Compute CPU number. All computes in the group have the same CPU count + // Required: true + CPU uint64 `url:"cpu" json:"cpu" validate:"required"` + + // Compute RAM volume in MB. All computes in the group have the same RAM volume + // Required: true + RAM uint64 `url:"ram" json:"ram" validate:"required"` + + // Compute boot disk size in GB + // Required: true + Disk uint64 `url:"disk" json:"disk" validate:"required"` + + // OS image ID to create computes from + // Required: true + ImageID uint64 `url:"imageId" json:"imageId" validate:"required"` + + // Compute driver + // should be one of: + // - KVM_X86 + // Required: true + Driver string `url:"driver" json:"driver" validate:"driver"` + + // Storage endpoint provider ID + // Required: false + SEPID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"` + + // Pool to use if sepId is set, can be also empty if needed to be chosen by system + // Required: false + SEPPool string `url:"sepPool,omitempty" json:"sepPool,omitempty"` + + // Group role tag. Can be empty string, does not have to be unique + // Required: false + Role string `url:"role,omitempty" json:"role,omitempty"` + + // List of ViNSes to connect computes to + // Required: false + VINSes []uint64 `url:"vinses,omitempty" json:"vinses,omitempty"` + + // List of external networks to connect computes to + // Required: false + ExtNets []uint64 `url:"extnets,omitempty" json:"extnets,omitempty"` + + // Time of Compute Group readiness + // Required: false + TimeoutStart uint64 `url:"timeoutStart,omitempty" json:"timeoutStart,omitempty"` + + // Meta data for working group computes, format YAML "user_data": 1111 + // Required: false + UserData string `url:"userData,omitempty" json:"userData,omitempty"` + + //Chipset "i440fx" or "Q35 + //Required: false + Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"chipset"` +} + +// GetRAM returns RAM field values +func (r GroupAddRequest) GetRAM() map[string]uint64 { + + res := make(map[string]uint64, 1) + + res["RAM"] = r.RAM + + return res +} + +// GroupAdd creates new Compute Group within BasicService. +// Compute Group is NOT started automatically, +// so you need to explicitly start it +func (b BService) GroupAdd(ctx context.Context, req GroupAddRequest) (uint64, error) { + err := validators.ValidateRequest(req) + if err != nil { + return 0, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupAdd" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return 0, err + } + + result, err := strconv.ParseUint(string(res), 10, 64) + if err != nil { + return 0, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_compute_remove.go b/pkg/cloudbroker/bservice/group_compute_remove.go new file mode 100644 index 0000000..65d7fd8 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_compute_remove.go @@ -0,0 +1,46 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupComputeRemoveRequest struct to remove group compute +type GroupComputeRemoveRequest struct { + // ID of the Basic Service + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute GROUP + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // ID of the Compute + // Required: true + ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` +} + +// GroupComputeRemove makes group compute remove of the Basic Service +func (b BService) GroupComputeRemove(ctx context.Context, req GroupComputeRemoveRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupComputeRemove" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_get.go b/pkg/cloudbroker/bservice/group_get.go new file mode 100644 index 0000000..f24b311 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_get.go @@ -0,0 +1,44 @@ +package bservice + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupGetRequest struct to get detailed information about Compute Group +type GroupGetRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` +} + +// GroupGet gets detailed specifications for the Compute Group +func (b BService) GroupGet(ctx context.Context, req GroupGetRequest) (*RecordGroup, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupGet" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return nil, err + } + + info := RecordGroup{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} diff --git a/pkg/cloudbroker/bservice/group_parent_remove.go b/pkg/cloudbroker/bservice/group_parent_remove.go new file mode 100644 index 0000000..2ca1a2a --- /dev/null +++ b/pkg/cloudbroker/bservice/group_parent_remove.go @@ -0,0 +1,48 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupParentRemoveRequest struct to remove parent Compute Group +// relation from the specified Compute Group +type GroupParentRemoveRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // ID of the parent Compute Group + // to remove from the current Compute Group + // Required: true + ParentID uint64 `url:"parentId" json:"parentId" validate:"required"` +} + +// GroupParentRemove removes parent Compute Group relation to the specified Compute Group +func (b BService) GroupParentRemove(ctx context.Context, req GroupParentRemoveRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupParentRemove" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_parrent_add.go b/pkg/cloudbroker/bservice/group_parrent_add.go new file mode 100644 index 0000000..38a4d00 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_parrent_add.go @@ -0,0 +1,46 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupParentAddRequest struct to add parent Compute Group relation to the specified Compute Group +type GroupParentAddRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // ID of the parent Compute Group to register with the current Compute Group + // Required: true + ParentID uint64 `url:"parentId" json:"parentId" validate:"required"` +} + +// GroupParentAdd add parent Compute Group relation to the specified Compute Group +func (b BService) GroupParentAdd(ctx context.Context, req GroupParentAddRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupParentAdd" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_remove.go b/pkg/cloudbroker/bservice/group_remove.go new file mode 100644 index 0000000..5456980 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_remove.go @@ -0,0 +1,43 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupRemoveRequest struct for destroy the specified Compute Group +type GroupRemoveRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` +} + +// GroupRemove destroy the specified Compute Group +func (b BService) GroupRemove(ctx context.Context, req GroupRemoveRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupRemove" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_resize.go b/pkg/cloudbroker/bservice/group_resize.go new file mode 100644 index 0000000..a94d028 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_resize.go @@ -0,0 +1,59 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupResizeRequest struct to resize the group +type GroupResizeRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group to resize + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // Either delta or absolute value of computes + // Required: true + Count int64 `url:"count" json:"count" validate:"required"` + + //Chipset for new computes, either i440fx or Q35 (i440fx by default) + //Available values : i440fx, Q35 + //Default value : i440fx + //Required: true + Chipset string `url:"chipset" json:"chipset" validate:"required,chipset"` + + // Either delta or absolute value of computes + // Should be one of: + // - ABSOLUTE + // - RELATIVE + // Required: true + Mode string `url:"mode" json:"mode" validate:"bserviceMode"` +} + +// GroupResize resize the group by changing the number of computes +func (b BService) GroupResize(ctx context.Context, req GroupResizeRequest) (uint64, error) { + err := validators.ValidateRequest(req) + if err != nil { + return 0, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupResize" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return 0, err + } + + result, err := strconv.ParseUint(string(res), 10, 64) + if err != nil { + return 0, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_start.go b/pkg/cloudbroker/bservice/group_start.go new file mode 100644 index 0000000..9ac7aae --- /dev/null +++ b/pkg/cloudbroker/bservice/group_start.go @@ -0,0 +1,42 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupStartRequest struct to start the specified Compute Group +type GroupStartRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group to start + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` +} + +// GroupStart starts the specified Compute Group within BasicService +func (b BService) GroupStart(ctx context.Context, req GroupStartRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupStart" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_stop.go b/pkg/cloudbroker/bservice/group_stop.go new file mode 100644 index 0000000..02ba1e5 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_stop.go @@ -0,0 +1,46 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupStopRequest struct to stop the specified Compute Group +type GroupStopRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group to stop + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // Force stop Compute Group + // Required: false + Force bool `url:"force,omitempty" json:"force,omitempty"` +} + +// GroupStop stops the specified Compute Group within BasicService +func (b BService) GroupStop(ctx context.Context, req GroupStopRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupStop" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_update.go b/pkg/cloudbroker/bservice/group_update.go new file mode 100644 index 0000000..31402fb --- /dev/null +++ b/pkg/cloudbroker/bservice/group_update.go @@ -0,0 +1,76 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupUpdateRequest struct to update existing Compute group +type GroupUpdateRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // Specify non-empty string to update Compute Group name + // Required: false + Name string `url:"name,omitempty" json:"name,omitempty"` + + // Specify non-empty string to update group role + // Required: false + Role string `url:"role,omitempty" json:"role,omitempty"` + + // Specify positive value to set new compute CPU count + // Required: false + CPU uint64 `url:"cpu,omitempty" json:"cpu,omitempty"` + + // Specify positive value to set new compute RAM volume in MB + // Required: false + RAM uint64 `url:"ram,omitempty" json:"ram,omitempty"` + + // Specify new compute boot disk size in GB + // Required: false + Disk uint64 `url:"disk,omitempty" json:"disk,omitempty"` + + // Force resize Compute Group + // Required: false + Force bool `url:"force,omitempty" json:"force,omitempty"` +} + +// GetRAM returns RAM field values +func (r GroupUpdateRequest) GetRAM() map[string]uint64 { + + res := make(map[string]uint64, 1) + + res["RAM"] = r.RAM + + return res +} + +// GroupUpdate updates existing Compute group within Basic Service and apply new settings to its computes as necessary +func (b BService) GroupUpdate(ctx context.Context, req GroupUpdateRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupUpdate" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_update_extnet.go b/pkg/cloudbroker/bservice/group_update_extnet.go new file mode 100644 index 0000000..73a6859 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_update_extnet.go @@ -0,0 +1,46 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupUpdateExtNetRequest struct to update External Network settings +type GroupUpdateExtNetRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // List of Extnets to connect computes + // Required: false + ExtNets []uint64 `url:"extnets,omitempty" json:"extnets,omitempty"` +} + +// GroupUpdateExtNet updates External Network settings for the group according to the new list +func (b BService) GroupUpdateExtNet(ctx context.Context, req GroupUpdateExtNetRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupUpdateExtnet" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/group_update_vins.go b/pkg/cloudbroker/bservice/group_update_vins.go new file mode 100644 index 0000000..185a515 --- /dev/null +++ b/pkg/cloudbroker/bservice/group_update_vins.go @@ -0,0 +1,46 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GroupUpdateVINSRequest struct to update VINS settings +type GroupUpdateVINSRequest struct { + // ID of the Basic Service of Compute Group + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // ID of the Compute Group + // Required: true + CompGroupID uint64 `url:"compgroupId" json:"compgroupId" validate:"required"` + + // List of ViNSes to connect computes + // Required: false + VINSes []uint64 `url:"vinses,omitempty" json:"vinses,omitempty"` +} + +// GroupUpdateVINS update ViNS settings for the group according to the new list +func (b BService) GroupUpdateVINS(ctx context.Context, req GroupUpdateVINSRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/groupUpdateVins" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/list.go b/pkg/cloudbroker/bservice/list.go new file mode 100644 index 0000000..7f04adb --- /dev/null +++ b/pkg/cloudbroker/bservice/list.go @@ -0,0 +1,87 @@ +package bservice + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// ListRequest struct to get list of BasicService instances +type ListRequest struct { + // Find by ID + // Required: false + ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"` + + // Find by name + // Required: false + Name string `url:"name,omitempty" json:"name,omitempty"` + + // ID of the account to query for BasicService instances + // Required: false + AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` + + // Find by resource group name + // Required: false + RGName string `url:"rgName,omitempty" json:"rgName,omitempty"` + + // ID of the resource group to query for BasicService instances + // Required: false + RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"` + + // Find by tech status + // Required: false + TechStatus string `url:"techStatus,omitempty" json:"techStatus,omitempty"` + + // Find by status + // Required: false + Status string `url:"status,omitempty" json:"status,omitempty"` + + // Find by account name + // Required: false + AccountName string `url:"accountName,omitempty" json:"accountName,omitempty"` + + // Sort by one of supported fields, format +|-(field) + // Required: false + SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` + + // Page number + // Required: false + Page uint64 `url:"page,omitempty" json:"page,omitempty"` + + // Page size + // Required: false + Size uint64 `url:"size,omitempty" json:"size,omitempty"` +} + +// List gets list of BasicService instances associated with the specified Resource Group as a ListBasicServices struct +func (b BService) List(ctx context.Context, req ListRequest) (*ListBasicServices, error) { + + res, err := b.ListRaw(ctx, req) + if err != nil { + return nil, err + } + + list := ListBasicServices{} + + err = json.Unmarshal(res, &list) + if err != nil { + return nil, err + } + + return &list, nil +} + +// ListRaw gets list of BasicService instances associated with the specified Resource Group as an array of bytes +func (b BService) ListRaw(ctx context.Context, req ListRequest) ([]byte, error) { + + if err := validators.ValidateRequest(req); err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/list" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudbroker/bservice/list_deleted.go b/pkg/cloudbroker/bservice/list_deleted.go new file mode 100644 index 0000000..c5f93a8 --- /dev/null +++ b/pkg/cloudbroker/bservice/list_deleted.go @@ -0,0 +1,56 @@ +package bservice + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// ListDeletedRequest struct to get list of deleted BasicService instances +type ListDeletedRequest struct { + // ID of the account to query for BasicService instances + // Required: false + AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` + + // ID of the resource group to query for BasicService instances + // Required: false + RGID uint64 `url:"rgId,omitempty" json:"rgId,omitempty"` + + // Sort by one of supported fields, format +|-(field) + // Required: false + SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"` + + // Page number + // Required: false + Page uint64 `url:"page,omitempty" json:"page,omitempty"` + + // Page size + // Required: false + Size uint64 `url:"size,omitempty" json:"size,omitempty"` +} + +// ListDeleted gets list of deleted BasicService instances associated with the specified Resource Group +func (b BService) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListBasicServices, error) { + + if err := validators.ValidateRequest(req); err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/listDeleted" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return nil, err + } + + list := ListBasicServices{} + + err = json.Unmarshal(res, &list) + if err != nil { + return nil, err + } + + return &list, nil +} diff --git a/pkg/cloudbroker/bservice/models.go b/pkg/cloudbroker/bservice/models.go new file mode 100644 index 0000000..08a0521 --- /dev/null +++ b/pkg/cloudbroker/bservice/models.go @@ -0,0 +1,401 @@ +package bservice + +// Detailed info about BasicService +type RecordBasicService struct { + // Account ID + AccountID uint64 `json:"accountId"` + + // Account name + AccountName string `json:"accountName"` + + // Base domain + BaseDomain string `json:"baseDomain"` + + // List Computes + Computes ListComputes `json:"computes"` + + // Number of cores + CPUTotal uint64 `json:"cpuTotal"` + + // Created by + CreatedBy string `json:"createdBy"` + + // Created time + CreatedTime uint64 `json:"createdTime"` + + // Deleted by + DeletedBy string `json:"deletedBy"` + + // Deleted time + DeletedTime uint64 `json:"deletedTime"` + + // Amount of disk space used, GB + DiskTotal uint64 `json:"diskTotal"` + + // Grid ID + GID uint64 `json:"gid"` + + // List of Service Compute Groups + Groups ListGroups `json:"groups"` + + // GUID + GUID uint64 `json:"guid"` + + // ID + ID uint64 `json:"id"` + + // Milestones + Milestones uint64 `json:"milestones"` + + // Name + Name string `json:"name"` + + // Parent service ID + ParentSrvID uint64 `json:"parentSrvId"` + + // Parent service type + ParentSrvType string `json:"parentSrvType"` + + // Total amount of RAM, MB + RAMTotal uint64 `json:"ramTotal"` + + // Resource group ID + RGID uint64 `json:"rgId"` + + // Resource group name + RGName string `json:"rgName"` + + // List of snapshots + Snapshots ListSnapshots `json:"snapshots"` + + // SSH key for connection + SSHKey string `json:"sshKey"` + + // Username for SSH connection + SSHUser string `json:"sshUser"` + + // status + Status string `json:"status"` + + // TechStatus + TechStatus string `json:"techStatus"` + + // Updated by + UpdatedBy string `json:"updatedBy"` + + // Updated time + UpdatedTime uint64 `json:"updatedTime"` + + // Whether user controlled + UserManaged bool `json:"userManaged"` +} + +// List of Groups +type ListGroups []ItemGroup + +// Main information about Group +type ItemGroup struct { + // Amount of computes + Computes uint64 `json:"computes"` + + // Consistency + Consistency bool `json:"consistency"` + + // Group ID + ID uint64 `json:"id"` + + // Group name + Name string `json:"name"` + + // Status + Status string `json:"status"` + + // TechStatus + TechStatus string `json:"techStatus"` +} + +// List of Computes +type ListComputes []ItemCompute + +// Main information about Compute +type ItemCompute struct { + // Account ID + AccountID uint64 `json:"accountId"` + + // Architecture + Architecture string `json:"arch"` + + // Compute group ID + CompGroupID uint64 `json:"compgroupId"` + + // Compute group name + CompGroupName string `json:"compgroupName"` + + // compute group role + CompGroupRole string `json:"compgroupRole"` + + // ID + ID uint64 `json:"id"` + + // Name + Name string `json:"name"` + + // Resource group ID + RGID uint64 `json:"rgId"` + + // StackID + StackID uint64 `json:"stackId"` + + // Status + Status string `json:"status"` + + // Tech status + TechStatus string `json:"techStatus"` +} + +// List of Snapshot +type ListSnapshots []ItemSnapshot + +// Main information about Snapshot +type ItemSnapshot struct { + // GUID + GUID string `json:"guid"` + + // Label + Label string `json:"label"` + + // Timestamp + Timestamp uint64 `json:"timestamp"` + + // Valid or not + Valid bool `json:"valid"` +} + +// List of BasicServices +type ListBasicServices struct { + Data []ItemBasicService `json:"data"` + + EntryCount uint64 `json:"entryCount"` +} + +// Main information about BasicService +type ItemBasicService struct { + // Account ID + AccountID uint64 `json:"accountId"` + + // Account name + AccountName string `json:"accountName"` + + // Base domain + BaseDomain string `json:"baseDomain"` + + // Created by + CreatedBy string `json:"createdBy"` + + // Created time + CreatedTime uint64 `json:"createdTime"` + + // Deleted by + DeletedBy string `json:"deletedBy"` + + // Deleted time + DeletedTime uint64 `json:"deletedTime"` + + // Grid ID + GID uint64 `json:"gid"` + + // List of group IDs + Groups []uint64 `json:"groups"` + + // GUID + GUID uint64 `json:"guid"` + + // ID + ID uint64 `json:"id"` + + // Name + Name string `json:"name"` + + // Milestones + Milestones uint64 `json:"milestones"` + + // Parent service ID + ParentSrvID uint64 `json:"parentSrvId"` + + // Parent service type + ParentSrvType string `json:"parentSrvType"` + + // Resource group ID + RGID uint64 `json:"rgId"` + + // Resource group name + RGName string `json:"rgName"` + + // List of snapshots + Snapshots ListSnapshots `json:"snapshots"` + + // SSH key for connection + SSHKey string `json:"sshKey"` + + // SSH user + SSHUser string `json:"sshUser"` + + // Status + Status string `json:"status"` + + // TechStatus + TechStatus string `json:"techStatus"` + + // Updated by + UpdatedBy string `json:"updatedBy"` + + // Updated time + UpdatedTime uint64 `json:"updatedTime"` + + // User Managed or not + UserManaged bool `json:"userManaged"` +} + +// List of Snapshots +type ListInfoSnapshots struct { + // Data + Data ListSnapshots `json:"data"` + + // EntryCount + EntryCount uint64 `json:"entryCount"` +} + +// Main information about Group +type RecordGroup struct { + // Account ID + AccountID uint64 `json:"accountId"` + + // Account Name + AccountName string `json:"accountName"` + + // List of Computes + Computes ListGroupComputes `json:"computes"` + + // Consistency or not + Consistency bool `json:"consistency"` + + // Number of CPU + CPU uint64 `json:"cpu"` + + // Created by + CreatedBy string `json:"createdBy"` + + // Created time + CreatedTime uint64 `json:"createdTime"` + + // Deleted by + DeletedBy string `json:"deletedBy"` + + // Deleted time + DeletedTime uint64 `json:"deletedTime"` + + // Amount of disk + Disk uint64 `json:"disk"` + + // Driver + Driver string `json:"driver"` + + // list of External Network IDs + ExtNets []uint64 `json:"extnets"` + + // Grid ID + GID uint64 `json:"gid"` + + // GUID + GUID uint64 `json:"guid"` + + // ID + ID uint64 `json:"id"` + + // Image ID + ImageID uint64 `json:"imageId"` + + // Milestones + Milestones uint64 `json:"milestones"` + + // Name + Name string `json:"name"` + + // List of Parent IDs + Parents []uint64 `json:"parents"` + + // Pool name + PoolName string `json:"poolName"` + + // Number of RAM, MB + RAM uint64 `json:"ram"` + + // Resource group ID + RGID uint64 `json:"rgId"` + + // Resource group name + RGName string `json:"rgName"` + + // Role + Role string `json:"role"` + + // SEPID + SEPID uint64 `json:"sepId"` + + // Sequence number + SeqNo uint64 `json:"seqNo"` + + // Service ID + ServiceID uint64 `json:"serviceId"` + + // Status + Status string `json:"status"` + + // TechStatus + TechStatus string `json:"techStatus"` + + // Timeout Start + TimeoutStart uint64 `json:"timeoutStart"` + + // Updated by + UpdatedBy string `json:"updatedBy"` + + // Updated time + UpdatedTime uint64 `json:"updatedTime"` + + // List of VINS IDs + VINSes []uint64 `json:"vinses"` +} + +// List of Group Computes +type ListGroupComputes []ItemGroupCompute + +// Main information about Group Compute +type ItemGroupCompute struct { + // ID + ID uint64 `json:"id"` + + // IP Addresses + IPAddresses []string `json:"ipAddresses"` + + // Name + Name string `json:"name"` + + // List of information about OS Users + OSUsers ListOSUsers `json:"osUsers"` + + //Chipset + Chipset string `json:"chipset"` +} + +// List of information about OS Users +type ListOSUsers []ItemOSUser + +// Main information about OS User +type ItemOSUser struct { + // Login + Login string `json:"login"` + + // Password + Password string `json:"password"` +} diff --git a/pkg/cloudbroker/bservice/restore.go b/pkg/cloudbroker/bservice/restore.go new file mode 100644 index 0000000..eefefa5 --- /dev/null +++ b/pkg/cloudbroker/bservice/restore.go @@ -0,0 +1,38 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// RestoreRequest struct to restore BasicService instance +type RestoreRequest struct { + // ID of the BasicService to be restored + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` +} + +// Restore restores BasicService instance +func (b BService) Restore(ctx context.Context, req RestoreRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/restore" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/snapshot_create.go b/pkg/cloudbroker/bservice/snapshot_create.go new file mode 100644 index 0000000..613fdb3 --- /dev/null +++ b/pkg/cloudbroker/bservice/snapshot_create.go @@ -0,0 +1,42 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// SnapshotCreateRequest struct to create snapshot +type SnapshotCreateRequest struct { + // ID of the Basic Service + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // Label of the snapshot + // Required: true + Label string `url:"label" json:"label" validate:"required"` +} + +// SnapshotCreate create snapshot of the Basic Service +func (b BService) SnapshotCreate(ctx context.Context, req SnapshotCreateRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/snapshotCreate" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/snapshot_delete.go b/pkg/cloudbroker/bservice/snapshot_delete.go new file mode 100644 index 0000000..f18ab30 --- /dev/null +++ b/pkg/cloudbroker/bservice/snapshot_delete.go @@ -0,0 +1,42 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// SnapshotDeleteRequest struct to delete snapshot +type SnapshotDeleteRequest struct { + // ID of the Basic Service + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // Label of the snapshot + // Required: true + Label string `url:"label" json:"label" validate:"required"` +} + +// SnapshotDelete delete snapshot of the Basic Service +func (b BService) SnapshotDelete(ctx context.Context, req SnapshotDeleteRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/snapshotDelete" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/snapshot_list.go b/pkg/cloudbroker/bservice/snapshot_list.go new file mode 100644 index 0000000..14aa5f7 --- /dev/null +++ b/pkg/cloudbroker/bservice/snapshot_list.go @@ -0,0 +1,40 @@ +package bservice + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// SnapshotListRequest struct to get list of existing snapshots +type SnapshotListRequest struct { + // ID of the Basic Service + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` +} + +// SnapshotList gets list existing snapshots of the Basic Service +func (b BService) SnapshotList(ctx context.Context, req SnapshotListRequest) (*ListInfoSnapshots, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/snapshotList" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return nil, err + } + + list := ListInfoSnapshots{} + + err = json.Unmarshal(res, &list) + if err != nil { + return nil, err + } + + return &list, nil +} diff --git a/pkg/cloudbroker/bservice/snapshot_rollback.go b/pkg/cloudbroker/bservice/snapshot_rollback.go new file mode 100644 index 0000000..446f7ba --- /dev/null +++ b/pkg/cloudbroker/bservice/snapshot_rollback.go @@ -0,0 +1,42 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// SnapshotRollbackRequest struct to rollback snapshot +type SnapshotRollbackRequest struct { + // ID of the Basic Service + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` + + // Label of the snapshot + // Required: true + Label string `url:"label" json:"label" validate:"required"` +} + +// SnapshotRollback rollback snapshot of the Basic Service +func (b BService) SnapshotRollback(ctx context.Context, req SnapshotRollbackRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/snapshotRollback" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/sorting.go b/pkg/cloudbroker/bservice/sorting.go new file mode 100644 index 0000000..3fdaed1 --- /dev/null +++ b/pkg/cloudbroker/bservice/sorting.go @@ -0,0 +1,60 @@ +package bservice + +import "sort" + +// SortByCreatedTime sorts ListBasicServices by the CreatedTime field in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lbs ListBasicServices) SortByCreatedTime(inverse bool) ListBasicServices { + if lbs.EntryCount < 2 { + return lbs + } + + sort.Slice(lbs.Data, func(i, j int) bool { + if inverse { + return lbs.Data[i].CreatedTime > lbs.Data[j].CreatedTime + } + + return lbs.Data[i].CreatedTime < lbs.Data[j].CreatedTime + }) + + return lbs +} + +// SortByUpdatedTime sorts ListBasicServices by the UpdatedTime field in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lbs ListBasicServices) SortByUpdatedTime(inverse bool) ListBasicServices { + if lbs.EntryCount < 2 { + return lbs + } + + sort.Slice(lbs.Data, func(i, j int) bool { + if inverse { + return lbs.Data[i].UpdatedTime > lbs.Data[j].UpdatedTime + } + + return lbs.Data[i].UpdatedTime < lbs.Data[j].UpdatedTime + }) + + return lbs +} + +// SortByDeletedTime sorts ListBasicServices by the DeletedTime field in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lbs ListBasicServices) SortByDeletedTime(inverse bool) ListBasicServices { + if lbs.EntryCount < 2 { + return lbs + } + + sort.Slice(lbs.Data, func(i, j int) bool { + if inverse { + return lbs.Data[i].DeletedTime > lbs.Data[j].DeletedTime + } + + return lbs.Data[i].DeletedTime < lbs.Data[j].DeletedTime + }) + + return lbs +} diff --git a/pkg/cloudbroker/bservice/start.go b/pkg/cloudbroker/bservice/start.go new file mode 100644 index 0000000..f00dd79 --- /dev/null +++ b/pkg/cloudbroker/bservice/start.go @@ -0,0 +1,40 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// StartRequest struct to start service +type StartRequest struct { + // ID of the service to start + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` +} + +// Start starts service. +// Starting a service technically means starting computes from all +// service groups according to group relations +func (b BService) Start(ctx context.Context, req StartRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/start" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/bservice/stop.go b/pkg/cloudbroker/bservice/stop.go new file mode 100644 index 0000000..b60ece6 --- /dev/null +++ b/pkg/cloudbroker/bservice/stop.go @@ -0,0 +1,40 @@ +package bservice + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// StopRequest struct to stop service +type StopRequest struct { + // ID of the service to stop + // Required: true + ServiceID uint64 `url:"serviceId" json:"serviceId" validate:"required"` +} + +// Stop stops service. +// Stopping a service technically means stopping computes from +// all service groups +func (b BService) Stop(ctx context.Context, req StopRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/bservice/stop" + + res, err := b.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/cloudbroker.go b/pkg/cloudbroker/cloudbroker.go index 361ef23..8a86865 100644 --- a/pkg/cloudbroker/cloudbroker.go +++ b/pkg/cloudbroker/cloudbroker.go @@ -1,7 +1,7 @@ // List of method groups for the admin package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to CloudBroker groups type CloudBroker struct { diff --git a/pkg/cloudbroker/compute.go b/pkg/cloudbroker/compute.go index 778cfc4..5bcc59d 100644 --- a/pkg/cloudbroker/compute.go +++ b/pkg/cloudbroker/compute.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/compute" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/compute" ) // Accessing the Compute method group diff --git a/pkg/cloudbroker/compute/affinity_group_check_start.go b/pkg/cloudbroker/compute/affinity_group_check_start.go index bbb90d8..bcb94bf 100644 --- a/pkg/cloudbroker/compute/affinity_group_check_start.go +++ b/pkg/cloudbroker/compute/affinity_group_check_start.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupCheckStartRequest struct to check all computes with current affinity label can start diff --git a/pkg/cloudbroker/compute/affinity_label_remove.go b/pkg/cloudbroker/compute/affinity_label_remove.go index cb7f229..9e68e33 100644 --- a/pkg/cloudbroker/compute/affinity_label_remove.go +++ b/pkg/cloudbroker/compute/affinity_label_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityLabelRemoveRequest struct for clear affinity label for compute diff --git a/pkg/cloudbroker/compute/affinity_label_set.go b/pkg/cloudbroker/compute/affinity_label_set.go index b535cac..9abd49e 100644 --- a/pkg/cloudbroker/compute/affinity_label_set.go +++ b/pkg/cloudbroker/compute/affinity_label_set.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityLabelSetRequest struct to set affinity label for compute diff --git a/pkg/cloudbroker/compute/affinity_relations.go b/pkg/cloudbroker/compute/affinity_relations.go index 74a4961..c35b97d 100644 --- a/pkg/cloudbroker/compute/affinity_relations.go +++ b/pkg/cloudbroker/compute/affinity_relations.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRelationsRequest struct to get dict of computes diff --git a/pkg/cloudbroker/compute/affinity_rule_add.go b/pkg/cloudbroker/compute/affinity_rule_add.go index d96635e..c238043 100644 --- a/pkg/cloudbroker/compute/affinity_rule_add.go +++ b/pkg/cloudbroker/compute/affinity_rule_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRuleAddRequest struct to add affinity rule diff --git a/pkg/cloudbroker/compute/affinity_rule_remove.go b/pkg/cloudbroker/compute/affinity_rule_remove.go index ec41aea..c46cc40 100644 --- a/pkg/cloudbroker/compute/affinity_rule_remove.go +++ b/pkg/cloudbroker/compute/affinity_rule_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRuleRemoveRequest struct to remove affinity rule diff --git a/pkg/cloudbroker/compute/affinity_rules_clear.go b/pkg/cloudbroker/compute/affinity_rules_clear.go index 3bc5754..f46bf1c 100644 --- a/pkg/cloudbroker/compute/affinity_rules_clear.go +++ b/pkg/cloudbroker/compute/affinity_rules_clear.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityRulesClearRequest struct to clear affinity rules diff --git a/pkg/cloudbroker/compute/anti_affinity_rule_add.go b/pkg/cloudbroker/compute/anti_affinity_rule_add.go index 1ff7abb..aa9d5f7 100644 --- a/pkg/cloudbroker/compute/anti_affinity_rule_add.go +++ b/pkg/cloudbroker/compute/anti_affinity_rule_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AntiAffinityRuleAddRequest struct to add anti affinity rule diff --git a/pkg/cloudbroker/compute/anti_affinity_rule_clear.go b/pkg/cloudbroker/compute/anti_affinity_rule_clear.go index 5d846f2..06e9b9b 100644 --- a/pkg/cloudbroker/compute/anti_affinity_rule_clear.go +++ b/pkg/cloudbroker/compute/anti_affinity_rule_clear.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AntiAffinityRulesClearRequest struct to clear anti affinity rules diff --git a/pkg/cloudbroker/compute/anti_affinity_rule_remove.go b/pkg/cloudbroker/compute/anti_affinity_rule_remove.go index 752092e..58078a1 100644 --- a/pkg/cloudbroker/compute/anti_affinity_rule_remove.go +++ b/pkg/cloudbroker/compute/anti_affinity_rule_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AntiAffinityRuleRemoveRequest struct to remove anti affinity rule diff --git a/pkg/cloudbroker/compute/attach_gpu.go b/pkg/cloudbroker/compute/attach_gpu.go index 475057e..0b492bf 100644 --- a/pkg/cloudbroker/compute/attach_gpu.go +++ b/pkg/cloudbroker/compute/attach_gpu.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AttachGPURequest struct to attach GPU for compute diff --git a/pkg/cloudbroker/compute/attach_pci_device.go b/pkg/cloudbroker/compute/attach_pci_device.go index 4945b72..6c09e45 100644 --- a/pkg/cloudbroker/compute/attach_pci_device.go +++ b/pkg/cloudbroker/compute/attach_pci_device.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AttachPCIDeviceRequest struct to attach PCI device diff --git a/pkg/cloudbroker/compute/audits.go b/pkg/cloudbroker/compute/audits.go index 81d965e..a1187d9 100644 --- a/pkg/cloudbroker/compute/audits.go +++ b/pkg/cloudbroker/compute/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to get audit records diff --git a/pkg/cloudbroker/compute/boot_disk_set.go b/pkg/cloudbroker/compute/boot_disk_set.go index 5445145..8b97736 100644 --- a/pkg/cloudbroker/compute/boot_disk_set.go +++ b/pkg/cloudbroker/compute/boot_disk_set.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BootDiskSetRequest struct to set boot disk for compute diff --git a/pkg/cloudbroker/compute/boot_order_get.go b/pkg/cloudbroker/compute/boot_order_get.go index 8368969..9b16968 100644 --- a/pkg/cloudbroker/compute/boot_order_get.go +++ b/pkg/cloudbroker/compute/boot_order_get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BootOrderGetRequest struct to get boot order diff --git a/pkg/cloudbroker/compute/boot_order_set.go b/pkg/cloudbroker/compute/boot_order_set.go index dcb577f..b865aca 100644 --- a/pkg/cloudbroker/compute/boot_order_set.go +++ b/pkg/cloudbroker/compute/boot_order_set.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BootOrderSetRequest struct to set boot order diff --git a/pkg/cloudbroker/compute/cd_eject.go b/pkg/cloudbroker/compute/cd_eject.go index a3f222e..ba72de0 100644 --- a/pkg/cloudbroker/compute/cd_eject.go +++ b/pkg/cloudbroker/compute/cd_eject.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CDEjectRequest struct to eject CD image diff --git a/pkg/cloudbroker/compute/cd_insert.go b/pkg/cloudbroker/compute/cd_insert.go index d99af27..1025bb3 100644 --- a/pkg/cloudbroker/compute/cd_insert.go +++ b/pkg/cloudbroker/compute/cd_insert.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CDInsertRequest struct to insert new CD image diff --git a/pkg/cloudbroker/compute/change_ip.go b/pkg/cloudbroker/compute/change_ip.go index 8d20168..92e3af6 100644 --- a/pkg/cloudbroker/compute/change_ip.go +++ b/pkg/cloudbroker/compute/change_ip.go @@ -5,30 +5,30 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ChangeIPRequest struct to change IP for network type ChangeIPRequest struct { // ID of compute instance // Required: true - ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` + ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"` // Network type // 'EXTNET' for connect to external network directly // 'VINS' for connect to ViNS // Required: true - NetType string `url:"netType" json:"netType" validate:"computeNetType"` + NetType string `url:"net_type" json:"net_type" validate:"computeNetType"` // Network ID for connect to // For EXTNET - external network ID // For VINS - VINS ID // Required: true - NetID uint64 `url:"netId" json:"netId" validate:"required"` + NetID uint64 `url:"net_id" json:"net_id" validate:"required"` // IP address to which we will change the existing one, it must be from the same subnet // Required: true - IPAddr string `url:"ipAddr" json:"ipAddr" validate:"required"` + IPAddr string `url:"ip_addr" json:"ip_addr" validate:"required"` } // ChangeIP change reserved IP for compute instance diff --git a/pkg/cloudbroker/compute/change_link_state.go b/pkg/cloudbroker/compute/change_link_state.go index e48790a..e47aad3 100644 --- a/pkg/cloudbroker/compute/change_link_state.go +++ b/pkg/cloudbroker/compute/change_link_state.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ChangeLinkStateRequest struct for changing link state diff --git a/pkg/cloudbroker/compute/change_mac.go b/pkg/cloudbroker/compute/change_mac.go new file mode 100644 index 0000000..6c64e5f --- /dev/null +++ b/pkg/cloudbroker/compute/change_mac.go @@ -0,0 +1,46 @@ +package compute + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// ChangeMACRequest struct to change MAC for network +type ChangeMACRequest struct { + // ID of compute instance + // Required: true + ComputeID uint64 `url:"compute_id" json:"compute_id" validate:"required"` + + // Current mac address + // Required: true + СurrentMAC string `url:"current_mac_address" json:"current_mac_address" validate:"required"` + + // the MAC address to which we will change the existing one + // Required: true + NewMAC string `url:"new_mac_address" json:"new_mac_address" validate:"required"` +} + +// ChangeMAC change MAC for compute instance +func (c Compute) ChangeMAC(ctx context.Context, req ChangeMACRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/compute/changeMac" + + res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/compute/clone.go b/pkg/cloudbroker/compute/clone.go index 2e22ba4..daf0a75 100644 --- a/pkg/cloudbroker/compute/clone.go +++ b/pkg/cloudbroker/compute/clone.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CloneRequest struct to clone compute instance diff --git a/pkg/cloudbroker/compute/compute.go b/pkg/cloudbroker/compute/compute.go index bedd2f6..922dbba 100644 --- a/pkg/cloudbroker/compute/compute.go +++ b/pkg/cloudbroker/compute/compute.go @@ -1,7 +1,7 @@ // API Actor for managing Compute. This actor is a final API for admin to manage Compute package compute -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to compute type Compute struct { diff --git a/pkg/cloudbroker/compute/computeci_set.go b/pkg/cloudbroker/compute/computeci_set.go index 3af7b68..ce3cb4b 100644 --- a/pkg/cloudbroker/compute/computeci_set.go +++ b/pkg/cloudbroker/compute/computeci_set.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeCISetRequest struct to set compute CI diff --git a/pkg/cloudbroker/compute/computeci_unset.go b/pkg/cloudbroker/compute/computeci_unset.go index f321dfa..37188a4 100644 --- a/pkg/cloudbroker/compute/computeci_unset.go +++ b/pkg/cloudbroker/compute/computeci_unset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeCIUnsetRequest struct to unset compute CI diff --git a/pkg/cloudbroker/compute/create_template.go b/pkg/cloudbroker/compute/create_template.go index 0ca49b3..0552764 100644 --- a/pkg/cloudbroker/compute/create_template.go +++ b/pkg/cloudbroker/compute/create_template.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateTemplateRequest struct to create template diff --git a/pkg/cloudbroker/compute/create_template_from_blank.go b/pkg/cloudbroker/compute/create_template_from_blank.go index 1e93ed0..aa92a7e 100644 --- a/pkg/cloudbroker/compute/create_template_from_blank.go +++ b/pkg/cloudbroker/compute/create_template_from_blank.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateTemplateFromBlankRequest struct to create template from boot disk of current compute @@ -39,10 +39,6 @@ type CreateTemplateFromBlankRequest struct { // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` - // SEP ID - // Required: false - SepID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"` - // Pool for image create // Required: false PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"` diff --git a/pkg/cloudbroker/compute/delete.go b/pkg/cloudbroker/compute/delete.go index a758811..63421f5 100644 --- a/pkg/cloudbroker/compute/delete.go +++ b/pkg/cloudbroker/compute/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete compute diff --git a/pkg/cloudbroker/compute/delete_custom_fields.go b/pkg/cloudbroker/compute/delete_custom_fields.go index 228e0a2..9a969a1 100644 --- a/pkg/cloudbroker/compute/delete_custom_fields.go +++ b/pkg/cloudbroker/compute/delete_custom_fields.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteCustomFieldsRequest struct to delete compute's custom fields diff --git a/pkg/cloudbroker/compute/detach_gpu.go b/pkg/cloudbroker/compute/detach_gpu.go index a8d00b2..915c32b 100644 --- a/pkg/cloudbroker/compute/detach_gpu.go +++ b/pkg/cloudbroker/compute/detach_gpu.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DetachGPURequest struct to detach VGPU for compute diff --git a/pkg/cloudbroker/compute/detach_pci_device.go b/pkg/cloudbroker/compute/detach_pci_device.go index 96767a7..3853972 100644 --- a/pkg/cloudbroker/compute/detach_pci_device.go +++ b/pkg/cloudbroker/compute/detach_pci_device.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DetachPCIDeviceRequest struct to detach PCI device diff --git a/pkg/cloudbroker/compute/disable.go b/pkg/cloudbroker/compute/disable.go index 101c691..5a20d60 100644 --- a/pkg/cloudbroker/compute/disable.go +++ b/pkg/cloudbroker/compute/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable compute diff --git a/pkg/cloudbroker/compute/disk_add.go b/pkg/cloudbroker/compute/disk_add.go index 120742e..3f07ff6 100644 --- a/pkg/cloudbroker/compute/disk_add.go +++ b/pkg/cloudbroker/compute/disk_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskAddRequest struct to create and attach disk to compute diff --git a/pkg/cloudbroker/compute/disk_attach.go b/pkg/cloudbroker/compute/disk_attach.go index a2c72ba..db72d4c 100644 --- a/pkg/cloudbroker/compute/disk_attach.go +++ b/pkg/cloudbroker/compute/disk_attach.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskAttachRequest struct to attach disk to compute diff --git a/pkg/cloudbroker/compute/disk_del.go b/pkg/cloudbroker/compute/disk_del.go index 0b3b9ed..2f496fa 100644 --- a/pkg/cloudbroker/compute/disk_del.go +++ b/pkg/cloudbroker/compute/disk_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskDelRequest struct to detach and delete disk from compute diff --git a/pkg/cloudbroker/compute/disk_detach.go b/pkg/cloudbroker/compute/disk_detach.go index 388e192..3925051 100644 --- a/pkg/cloudbroker/compute/disk_detach.go +++ b/pkg/cloudbroker/compute/disk_detach.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskDetachRequest struct to detach disk from compute diff --git a/pkg/cloudbroker/compute/disk_migrate.go b/pkg/cloudbroker/compute/disk_migrate.go index 391e7f5..6a8aa7e 100644 --- a/pkg/cloudbroker/compute/disk_migrate.go +++ b/pkg/cloudbroker/compute/disk_migrate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskMigrateRequest struct to migrate compute's disk to target disk diff --git a/pkg/cloudbroker/compute/disk_qos.go b/pkg/cloudbroker/compute/disk_qos.go index 3cdf2ec..4c84c77 100644 --- a/pkg/cloudbroker/compute/disk_qos.go +++ b/pkg/cloudbroker/compute/disk_qos.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskQOSRequest struct to change QOS of the disk diff --git a/pkg/cloudbroker/compute/disk_resize.go b/pkg/cloudbroker/compute/disk_resize.go index 69c5f86..2c97690 100644 --- a/pkg/cloudbroker/compute/disk_resize.go +++ b/pkg/cloudbroker/compute/disk_resize.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskResizeRequest struct to change disk size diff --git a/pkg/cloudbroker/compute/disk_switch_to_replication.go b/pkg/cloudbroker/compute/disk_switch_to_replication.go index 689b1db..3087e2b 100644 --- a/pkg/cloudbroker/compute/disk_switch_to_replication.go +++ b/pkg/cloudbroker/compute/disk_switch_to_replication.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskSwitchToReplicationRequest struct to switch disk to it's replication diff --git a/pkg/cloudbroker/compute/enable.go b/pkg/cloudbroker/compute/enable.go index 5fdbf62..40d2b11 100644 --- a/pkg/cloudbroker/compute/enable.go +++ b/pkg/cloudbroker/compute/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable compute diff --git a/pkg/cloudbroker/compute/filter.go b/pkg/cloudbroker/compute/filter.go index 4d791b2..85e88fb 100644 --- a/pkg/cloudbroker/compute/filter.go +++ b/pkg/cloudbroker/compute/filter.go @@ -3,9 +3,9 @@ package compute import ( "context" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/k8s" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/lb" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/lb" ) // FilterByID returns ListComputes with specified ID. @@ -168,3 +168,164 @@ func (lc ListComputes) FindOne() ItemCompute { return lc.Data[0] } + +// FilterByID returns ListDeletedComputes with specified ID. +func (lc ListDeletedComputes) FilterByID(id uint64) ListDeletedComputes { + predicate := func(ic ItemDeletedCompute) bool { + return ic.ID == id + } + + return lc.FilterFunc(predicate) +} + +// FilterByName returns ListDeletedComputes with specified Name. +func (lc ListDeletedComputes) FilterByName(name string) ListDeletedComputes { + predicate := func(ic ItemDeletedCompute) bool { + return ic.Name == name + } + + return lc.FilterFunc(predicate) +} + +// FilterByStatus returns ListDeletedComputes with specified Status. +func (lc ListDeletedComputes) FilterByStatus(status string) ListDeletedComputes { + predicate := func(ic ItemDeletedCompute) bool { + return ic.Status == status + } + + return lc.FilterFunc(predicate) +} + +// FilterByTechStatus returns ListDeletedComputes with specified TechStatus. +func (lc ListDeletedComputes) FilterByTechStatus(techStatus string) ListDeletedComputes { + predicate := func(ic ItemDeletedCompute) bool { + return ic.TechStatus == techStatus + } + + return lc.FilterFunc(predicate) +} + +// FilterByDiskID return ListDeletedComputes with specified DiskID. +func (lc ListDeletedComputes) FilterByDiskID(diskID uint64) ListDeletedComputes { + predicate := func(ic ItemDeletedCompute) bool { + for _, disk := range ic.Disks { + if disk.ID == diskID { + return true + } + } + return false + } + + return lc.FilterFunc(predicate) +} + +// FilterByK8SID returns master and worker nodes (ListDeletedComputes) inside specified K8S cluster. +func (lc ListDeletedComputes) FilterByK8SID(ctx context.Context, k8sID uint64, decortClient interfaces.Caller) (*ListDeletedComputes, error) { + caller := k8s.New(decortClient) + + req := k8s.GetRequest{ + K8SID: k8sID, + } + + cluster, err := caller.Get(ctx, req) + if err != nil { + return nil, err + } + + predicate := func(ic ItemDeletedCompute) bool { + for _, info := range cluster.K8SGroups.Masters.DetailedInfo { + if info.ID == ic.ID { + return true + } + } + + for _, worker := range cluster.K8SGroups.Workers { + for _, info := range worker.DetailedInfo { + if info.ID == ic.ID { + return true + } + } + } + + return false + } + + result := lc.FilterFunc(predicate) + + return &result, nil +} + +// K8SMasters is used to filter master nodes. Best used after FilterByK8SID function. +func (lc ListDeletedComputes) FilterByK8SMasters() ListDeletedComputes { + predicate := func(ic ItemDeletedCompute) bool { + for _, rule := range ic.AntiAffinityRules { + if rule.Value == "master" { + return true + } + } + return false + } + + return lc.FilterFunc(predicate) +} + +// K8SMasters is used to filter worker nodes. Best used after FilterByK8SID function. +func (lc ListDeletedComputes) FilterByK8SWorkers() ListDeletedComputes { + predicate := func(ic ItemDeletedCompute) bool { + for _, rule := range ic.AntiAffinityRules { + if rule.Value == "worker" { + return true + } + } + return false + } + + return lc.FilterFunc(predicate) +} + +// FilterByLBID is used to filter ListDeletedComputes used by specified Load Balancer. +func (lc ListDeletedComputes) FilterByLBID(ctx context.Context, lbID uint64, decortClient interfaces.Caller) (*ListDeletedComputes, error) { + caller := lb.New(decortClient) + + req := lb.GetRequest{ + LBID: lbID, + } + + foundLB, err := caller.Get(ctx, req) + if err != nil { + return nil, err + } + + predicate := func(ic ItemDeletedCompute) bool { + return ic.ID == foundLB.PrimaryNode.ComputeID || ic.ID == foundLB.SecondaryNode.ComputeID + } + + result := lc.FilterFunc(predicate) + + return &result, nil +} + +// FilterFunc allows filtering ListDeletedComputes based on a user-specified predicate. +func (lc ListDeletedComputes) FilterFunc(predicate func(ItemDeletedCompute) bool) ListDeletedComputes { + var result ListDeletedComputes + + for _, item := range lc.Data { + if predicate(item) { + result.Data = append(result.Data, item) + } + } + + result.EntryCount = uint64(len(result.Data)) + + return result +} + +// FindOne returns first found ItemDeletedCompute +// If none was found, returns an empty struct. +func (lc ListDeletedComputes) FindOne() ItemDeletedCompute { + if len(lc.Data) == 0 { + return ItemDeletedCompute{} + } + + return lc.Data[0] +} diff --git a/pkg/cloudbroker/compute/filter_test.go b/pkg/cloudbroker/compute/filter_test.go index ce76bd3..cca037f 100644 --- a/pkg/cloudbroker/compute/filter_test.go +++ b/pkg/cloudbroker/compute/filter_test.go @@ -9,8 +9,7 @@ var computes = ListComputes{ { Disks: []InfoDisk{ { - ID: 65191, - PCISlot: 6, + ID: 65191, }, }, InfoCompute: InfoCompute{ @@ -67,7 +66,7 @@ var computes = ListComputes{ MigrationJob: 0, Milestones: 363500, Name: "test", - Pinned: false, + PinnedToStack: 1, RAM: 4096, ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e", Registered: true, @@ -92,8 +91,7 @@ var computes = ListComputes{ { Disks: []InfoDisk{ { - ID: 65248, - PCISlot: 6, + ID: 65248, }, }, InfoCompute: InfoCompute{ @@ -132,7 +130,7 @@ var computes = ListComputes{ MigrationJob: 0, Milestones: 363853, Name: "compute_2", - Pinned: false, + PinnedToStack: 1, RAM: 4096, ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff", Registered: true, @@ -248,3 +246,244 @@ func TestSortingByCPU(t *testing.T) { t.Fatal("expected 6 CPU cores, found: ", actual.Data[0].CPUs) } } + +var deleteComputes = ListDeletedComputes{ + Data: []ItemDeletedCompute{ + { + Disks: []InfoDisk{ + { + ID: 65191, + }, + }, + InfoCompute: InfoCompute{ + ACL: []interface{}{}, + AccountID: 132847, + AccountName: "std_2", + AffinityLabel: "", + AffinityRules: []ItemRule{ + { + GUID: "", + Key: "aff_key", + Mode: "ANY", + Policy: "RECOMMENDED", + Topology: "compute", + Value: "aff_val", + }, + }, + AffinityWeight: 0, + AntiAffinityRules: []ItemRule{ + { + GUID: "", + Key: "antiaff_key", + Mode: "ANY", + Policy: "RECOMMENDED", + Topology: "compute", + Value: "antiaff_val", + }, + }, + Arch: "X86_64", + BootOrder: []string{ + "hd", "cdrom", + }, + BootDiskSize: 0, + CloneReference: 0, + Clones: []uint64{}, + ComputeCIID: 0, + CPUs: 4, + CreatedBy: "timofey_tkachev_1@decs3o", + CreatedTime: 1676975175, + CustomFields: map[string]interface{}{}, + DeletedBy: "", + DeletedTime: 0, + Description: "", + Devices: nil, + Driver: "KVM_X86", + GID: 212, + GUID: 48500, + ID: 48500, + ImageID: 9884, + Interfaces: ListInterfaces{}, + LockStatus: "UNLOCKED", + ManagerID: 0, + ManagerType: "", + MigrationJob: 0, + Milestones: 363500, + Name: "test", + RAM: 4096, + ReferenceID: "c7cb19ac-af4a-4067-852f-c5572949207e", + Registered: true, + ResName: "compute-48500", + RGID: 79724, + RGName: "std_broker2", + SnapSets: ListSnapshots{}, + StatelessSEPID: 0, + StatelessSEPType: "", + Status: "ENABLED", + Tags: map[string]interface{}{}, + TechStatus: "STOPPED", + TotalDiskSize: 2, + UpdatedBy: "", + UpdatedTime: 1677058904, + UserManaged: true, + VGPUs: []uint64{}, + VINSConnected: 0, + VirtualImageID: 0, + }, + }, + { + Disks: []InfoDisk{ + { + ID: 65248, + }, + }, + InfoCompute: InfoCompute{ + ACL: []interface{}{}, + AccountID: 132848, + AccountName: "std_broker", + AffinityLabel: "", + AffinityRules: []ItemRule{}, + AffinityWeight: 0, + AntiAffinityRules: []ItemRule{}, + Arch: "X86_64", + BootOrder: []string{ + "hd", "cdrom", + }, + BootDiskSize: 0, + CloneReference: 0, + Clones: []uint64{}, + ComputeCIID: 0, + CPUs: 6, + CreatedBy: "timofey_tkachev_1@decs3o", + CreatedTime: 1677579436, + CustomFields: map[string]interface{}{}, + DeletedBy: "", + DeletedTime: 0, + Description: "", + Devices: nil, + Driver: "KVM_X86", + GID: 212, + GUID: 48556, + ID: 48556, + ImageID: 9884, + Interfaces: ListInterfaces{}, + LockStatus: "UNLOCKED", + ManagerID: 0, + ManagerType: "", + MigrationJob: 0, + Milestones: 363853, + Name: "compute_2", + RAM: 4096, + ReferenceID: "a542c449-5b1c-4f90-88c5-7bb5f8ae68ff", + Registered: true, + ResName: "compute-48556", + RGID: 79727, + RGName: "sdk_negative_fields_test", + SnapSets: ListSnapshots{}, + StatelessSEPID: 0, + StatelessSEPType: "", + Status: "ENABLED", + Tags: map[string]interface{}{}, + TechStatus: "STARTED", + TotalDiskSize: 1, + UpdatedBy: "", + UpdatedTime: 1677579436, + UserManaged: true, + VGPUs: []uint64{}, + VINSConnected: 0, + VirtualImageID: 0, + }, + }, + }, + EntryCount: 2, +} + +func TestFilterDeleteByID(t *testing.T) { + actual := deleteComputes.FilterByID(48500).FindOne() + + if actual.ID != 48500 { + t.Fatal("expected ID 48500, found: ", actual.ID) + } + + actualEmpty := deleteComputes.FilterByID(0) + + if len(actualEmpty.Data) != 0 { + t.Fatal("expected empty, actual: ", len(actualEmpty.Data)) + } +} + +func TestFilterDeleteByName(t *testing.T) { + actual := deleteComputes.FilterByName("compute_2").FindOne() + + if actual.Name != "compute_2" { + t.Fatal("expected compute with name 'test', found: ", actual.Name) + } +} + +func TestFilterDeleteByStatus(t *testing.T) { + actual := deleteComputes.FilterByStatus("ENABLED") + + for _, item := range actual.Data { + if item.Status != "ENABLED" { + t.Fatal("expected ENABLED status, found: ", item.Status) + } + } +} + +func TestFilterDeleteByTechStatus(t *testing.T) { + actual := deleteComputes.FilterByTechStatus("STARTED").FindOne() + + if actual.ID != 48556 { + t.Fatal("expected 48556 with STARTED techStatus, found: ", actual.ID) + } +} + +func TestFilterDeleteByDiskID(t *testing.T) { + actual := deleteComputes.FilterByDiskID(65248).FindOne() + + if actual.ID != 48556 { + t.Fatal("expected 48556 with DiskID 65248, found: ", actual.ID) + } +} + +func TestFilterDeleteFunc(t *testing.T) { + actual := deleteComputes.FilterFunc(func(ic ItemDeletedCompute) bool { + return ic.Registered == true + }) + + if len(actual.Data) != 2 { + t.Fatal("expected 2 elements found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + if item.Registered != true { + t.Fatal("expected Registered to be true, actual: ", item.Registered) + } + } +} + +func TestDeleteSortingByCreatedTime(t *testing.T) { + actual := deleteComputes.SortByCreatedTime(false) + + if actual.Data[0].Name != "test" { + t.Fatal("expected 'test', found: ", actual.Data[0].Name) + } + + actual = deleteComputes.SortByCreatedTime(true) + if actual.Data[0].Name != "compute_2" { + t.Fatal("expected 'compute_2', found: ", actual.Data[0].Name) + } +} + +func TestDeleteSortingByCPU(t *testing.T) { + actual := deleteComputes.SortByCPU(false) + + if actual.Data[0].CPUs != 4 { + t.Fatal("expected 4 CPU cores, found: ", actual.Data[0].CPUs) + } + + actual = deleteComputes.SortByCPU(true) + + if actual.Data[0].CPUs != 6 { + t.Fatal("expected 6 CPU cores, found: ", actual.Data[0].CPUs) + } +} diff --git a/pkg/cloudbroker/compute/get.go b/pkg/cloudbroker/compute/get.go index c2113b4..321a24d 100644 --- a/pkg/cloudbroker/compute/get.go +++ b/pkg/cloudbroker/compute/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest to get information about compute diff --git a/pkg/cloudbroker/compute/get_audits.go b/pkg/cloudbroker/compute/get_audits.go index 6377017..6fb7074 100644 --- a/pkg/cloudbroker/compute/get_audits.go +++ b/pkg/cloudbroker/compute/get_audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetAuditsRequest struct to get compute audits diff --git a/pkg/cloudbroker/compute/get_console_url.go b/pkg/cloudbroker/compute/get_console_url.go index a50cb9e..29d11a5 100644 --- a/pkg/cloudbroker/compute/get_console_url.go +++ b/pkg/cloudbroker/compute/get_console_url.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetConsoleURLRequest struct to get console URL diff --git a/pkg/cloudbroker/compute/get_custom_fields.go b/pkg/cloudbroker/compute/get_custom_fields.go index 34bc6d6..de0c2b4 100644 --- a/pkg/cloudbroker/compute/get_custom_fields.go +++ b/pkg/cloudbroker/compute/get_custom_fields.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetCustomFieldsRequest struct to get Compute's customFields diff --git a/pkg/cloudbroker/compute/get_log.go b/pkg/cloudbroker/compute/get_log.go index f604d89..5ac874e 100644 --- a/pkg/cloudbroker/compute/get_log.go +++ b/pkg/cloudbroker/compute/get_log.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetLogRequest struct to get compute logs diff --git a/pkg/cloudbroker/compute/list.go b/pkg/cloudbroker/compute/list.go index 7182627..074f99f 100644 --- a/pkg/cloudbroker/compute/list.go +++ b/pkg/cloudbroker/compute/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of available computes @@ -54,6 +54,10 @@ type ListRequest struct { // Required: false CDImageID uint64 `url:"cdImageId,omitempty" json:"cdImageId,omitempty"` + // Find by stack name + // Required: false + StackName string `url:"stackName,omitempty" json:"stackName,omitempty"` + // Find by external network name // Required: false ExtNetName string `url:"extNetName,omitempty" json:"extNetName,omitempty"` diff --git a/pkg/cloudbroker/compute/list_deleted.go b/pkg/cloudbroker/compute/list_deleted.go index 524a6ff..240f373 100644 --- a/pkg/cloudbroker/compute/list_deleted.go +++ b/pkg/cloudbroker/compute/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get deleted computes list @@ -60,7 +60,7 @@ type ListDeletedRequest struct { } // ListDeleted gets list all deleted computes -func (c Compute) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListComputes, error) { +func (c Compute) ListDeleted(ctx context.Context, req ListDeletedRequest) (*ListDeletedComputes, error) { if err := validators.ValidateRequest(req); err != nil { return nil, validators.ValidationErrors(validators.GetErrors(err)) @@ -73,7 +73,7 @@ func (c Compute) ListDeleted(ctx context.Context, req ListDeletedRequest) (*List return nil, err } - list := ListComputes{} + list := ListDeletedComputes{} err = json.Unmarshal(res, &list) if err != nil { diff --git a/pkg/cloudbroker/compute/list_pci_device.go b/pkg/cloudbroker/compute/list_pci_device.go index bf9dec8..b27c63d 100644 --- a/pkg/cloudbroker/compute/list_pci_device.go +++ b/pkg/cloudbroker/compute/list_pci_device.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListPCIDeviceRequest struct to get list of PCI devices diff --git a/pkg/cloudbroker/compute/list_vgpu.go b/pkg/cloudbroker/compute/list_vgpu.go index a8788a9..9c760b8 100644 --- a/pkg/cloudbroker/compute/list_vgpu.go +++ b/pkg/cloudbroker/compute/list_vgpu.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListVGPURequest struct to get list of GPU for compute diff --git a/pkg/cloudbroker/compute/mass_delete.go b/pkg/cloudbroker/compute/mass_delete.go index 4503743..68f1db3 100644 --- a/pkg/cloudbroker/compute/mass_delete.go +++ b/pkg/cloudbroker/compute/mass_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassDeleteRequest struct to delete several computes diff --git a/pkg/cloudbroker/compute/mass_reboot.go b/pkg/cloudbroker/compute/mass_reboot.go index 2248c9e..7405397 100644 --- a/pkg/cloudbroker/compute/mass_reboot.go +++ b/pkg/cloudbroker/compute/mass_reboot.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassRebootRequest struct to reboot several computes diff --git a/pkg/cloudbroker/compute/mass_repair_boot_fs.go b/pkg/cloudbroker/compute/mass_repair_boot_fs.go deleted file mode 100644 index 5895b43..0000000 --- a/pkg/cloudbroker/compute/mass_repair_boot_fs.go +++ /dev/null @@ -1,38 +0,0 @@ -package compute - -import ( - "context" - "net/http" - "strconv" - - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" -) - -// MassRepairBootFSRequest struct to repair boot disk filesystem on several computes -type MassRepairBootFSRequest struct { - // IDs of compute instances which boot file systems will be repaired - // Required: true - ComputeIDs []uint64 `url:"computeIds" json:"computeIds" validate:"min=1"` -} - -// MassRepairBootFS repairs boot disk filesystem on several computes -func (c Compute) MassRepairBootFS(ctx context.Context, req MassRepairBootFSRequest) (bool, error) { - err := validators.ValidateRequest(req) - if err != nil { - return false, validators.ValidationErrors(validators.GetErrors(err)) - } - - url := "/cloudbroker/compute/massRepairBootFs" - - res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) - if err != nil { - return false, err - } - - result, err := strconv.ParseBool(string(res)) - if err != nil { - return false, err - } - - return result, nil -} diff --git a/pkg/cloudbroker/compute/mass_start.go b/pkg/cloudbroker/compute/mass_start.go index dee80f8..173242b 100644 --- a/pkg/cloudbroker/compute/mass_start.go +++ b/pkg/cloudbroker/compute/mass_start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassStartRequest struct to start several computes diff --git a/pkg/cloudbroker/compute/mass_stop.go b/pkg/cloudbroker/compute/mass_stop.go index b200320..b76bf24 100644 --- a/pkg/cloudbroker/compute/mass_stop.go +++ b/pkg/cloudbroker/compute/mass_stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassStopRequest struct to stop several computes diff --git a/pkg/cloudbroker/compute/migrate.go b/pkg/cloudbroker/compute/migrate.go index 2ce92e4..48d46a1 100644 --- a/pkg/cloudbroker/compute/migrate.go +++ b/pkg/cloudbroker/compute/migrate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MigrateRequest struct to migrate compute diff --git a/pkg/cloudbroker/compute/migrate_storage.go b/pkg/cloudbroker/compute/migrate_storage.go index 5c2a4c7..cc23c97 100644 --- a/pkg/cloudbroker/compute/migrate_storage.go +++ b/pkg/cloudbroker/compute/migrate_storage.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MigrateStorageRequest struct for migration diff --git a/pkg/cloudbroker/compute/migrate_storage_abort.go b/pkg/cloudbroker/compute/migrate_storage_abort.go index 328e417..4dc2ad5 100644 --- a/pkg/cloudbroker/compute/migrate_storage_abort.go +++ b/pkg/cloudbroker/compute/migrate_storage_abort.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MigrateStorageAbortRequest struct to abort migration diff --git a/pkg/cloudbroker/compute/migrate_storage_clean_up.go b/pkg/cloudbroker/compute/migrate_storage_clean_up.go index ac9e484..22cde3f 100644 --- a/pkg/cloudbroker/compute/migrate_storage_clean_up.go +++ b/pkg/cloudbroker/compute/migrate_storage_clean_up.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MigrateStorageCleanUpRequest struct to cleanup resources after finished migration diff --git a/pkg/cloudbroker/compute/migrate_storage_info.go b/pkg/cloudbroker/compute/migrate_storage_info.go index 0754472..db3239a 100644 --- a/pkg/cloudbroker/compute/migrate_storage_info.go +++ b/pkg/cloudbroker/compute/migrate_storage_info.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MigrateStorageInfoRequest struct to get info about migration diff --git a/pkg/cloudbroker/compute/models.go b/pkg/cloudbroker/compute/models.go index a5f73cc..24572fa 100644 --- a/pkg/cloudbroker/compute/models.go +++ b/pkg/cloudbroker/compute/models.go @@ -425,13 +425,13 @@ type ItemDisk struct { Password string `json:"passwd"` // PCI slot - PCISlot int64 `json:"pciSlot"` + PCISlot int64 `json:"pci_slot"` // Pool Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Purge attempts PurgeAttempts uint64 `json:"purgeAttempts"` @@ -469,6 +469,9 @@ type ItemDisk struct { // Size used SizeUsed float64 `json:"sizeUsed"` + // Size available + SizeAvailable float64 `json:"sizeAvailable"` + // List detailed snapshots Snapshots ListDetailedSnapshots `json:"snapshots"` @@ -482,7 +485,7 @@ type ItemDisk struct { Type string `json:"type"` // Updated by - UpdatedBy uint64 `json:"updatedBy,omitempty"` + UpdatedBy string `json:"updatedBy"` // Virtual machine ID VMID uint64 `json:"vmid"` @@ -633,6 +636,9 @@ type InfoCompute struct { // Boot order BootOrder []string `json:"bootOrder"` + // Boot type + BootType string `json:"bootType"` + // Boot disk size BootDiskSize uint64 `json:"bootdiskSize"` @@ -690,6 +696,9 @@ type InfoCompute struct { // HPBacked HPBacked bool `json:"hpBacked"` + // Hot resize + HotResize bool `json:"hotResize"` + // ID ID uint64 `json:"id"` @@ -699,6 +708,9 @@ type InfoCompute struct { // List interfaces Interfaces ListInterfaces `json:"interfaces"` + // Loader type + LoaderType string `json:"loaderType"` + // Lock status LockStatus string `json:"lockStatus"` @@ -720,6 +732,9 @@ type InfoCompute struct { // Need reboot NeedReboot bool `json:"needReboot"` + // network interface naming + NetworkInterfaceNaming string `json:"networkInterfaceNaming"` + // Numa Affinity NumaAffinity string `json:"numaAffinity"` @@ -729,8 +744,8 @@ type InfoCompute struct { // List OS users OSUsers ListOSUsers `json:"osUsers"` - // Pinned - Pinned bool `json:"pinned"` + // Pinned to stack + PinnedToStack int64 `json:"pinnedToStack"` // PreferredCPU PreferredCPU []int64 `json:"preferredCpu"` @@ -861,6 +876,9 @@ type RecordCompute struct { // Boot order BootOrder []string `json:"bootOrder"` + // Boot type + BootType string `json:"bootType"` + // Boot disk size BootDiskSize uint64 `json:"bootdiskSize"` @@ -921,6 +939,9 @@ type RecordCompute struct { // HPBacked HPBacked bool `json:"hpBacked"` + // Hot resize + HotResize bool `json:"hotResize"` + // ID ID uint64 `json:"id"` @@ -933,6 +954,9 @@ type RecordCompute struct { // List interfaces Interfaces ListInterfaces `json:"interfaces"` + // Loader type + LoaderType string `json:"loaderType"` + // Lock status LockStatus string `json:"lockStatus"` @@ -972,6 +996,9 @@ type RecordCompute struct { // Need reboot NeedReboot bool `json:"needReboot"` + // network interface naming + NetworkInterfaceNaming string `json:"networkInterfaceNaming"` + // NumaAffinity NumaAffinity string `json:"numaAffinity"` @@ -981,8 +1008,8 @@ type RecordCompute struct { // List OS users OSUsers ListOSUsers `json:"osUsers"` - // Pinned - Pinned bool `json:"pinned"` + // Pinned to stack + PinnedToStack int64 `json:"pinnedToStack"` // PreferredCPU PreferredCPU []int64 `json:"preferredCpu"` @@ -1047,8 +1074,8 @@ type RecordCompute struct { // Userdata Userdata interface{} `json:"userdata"` - // List VGPU IDs - VGPUs []uint64 `json:"vgpus"` + // List VGPU + VGPUs []VGPUItem `json:"vgpus"` // Virtual image ID VirtualImageID uint64 `json:"virtualImageId"` @@ -1060,6 +1087,65 @@ type RecordCompute struct { VNCPassword string `json:"vncPasswd"` } +type VGPUItem struct { + // ID + ID uint64 `json:"id"` + + // GID + GID uint64 `json:"gid"` + + // Type + Type string `json:"type"` + + // Mode + Mode string `json:"mode"` + + // Status + Status string `json:"status"` + + // ProfileID + ProfileID uint64 `json:"profileId"` + + // RAM + RAM uint64 `json:"ram"` + + // LastUpdateTime + LastUpdateTime uint64 `json:"lastUpdateTime"` + + // CreatedTime + CreatedTime uint64 `json:"createdTime"` + + // DeletedTime + DeletedTime uint64 `json:"deletedTime"` + + // VMID + VMID uint64 `json:"vmid"` + + // PGPuid + PGPuid uint64 `json:"pgpuid"` + + // ReferenceID + ReferenceID string `json:"referenceId"` + + // AccountID + AccountID uint64 `json:"accountId"` + + // RgID + RgID uint64 `json:"rgId"` + + // LastClaimedBy + LastClaimedBy uint64 `json:"lastClaimedBy"` + + // PCISlot + PCISlot uint64 `json:"pciSlot"` + + // BusNumber + BusNumber uint64 `json:"bus_number"` + + // GUID + GUID uint64 `json:"guid"` +} + // Information about of disk IDs type ListInfoDisks []InfoDisk @@ -1071,6 +1157,24 @@ type ItemCompute struct { // Main information about compute InfoCompute + // NID + NID uint64 `json:"nid"` + + // Total disk size + TotalDiskSize uint64 `json:"totalDisksSize"` + + // VINS connected + VINSConnected uint64 `json:"vinsConnected"` +} + +// Main information about compute for list +type ItemDeletedCompute struct { + // List of disk IDs + Disks ListInfoDisks `json:"disks"` + + // Main information about compute + InfoCompute + // Total disk size TotalDiskSize uint64 `json:"totalDisksSize"` @@ -1080,14 +1184,8 @@ type ItemCompute struct { // Information Disk type InfoDisk struct { - // Bus number - BusNumber uint64 `json:"bus_number"` - // ID ID uint64 `json:"id"` - - // PCISlot - PCISlot int64 `json:"pciSlot"` } // List computes @@ -1099,6 +1197,15 @@ type ListComputes struct { EntryCount uint64 `json:"entryCount"` } +// List computes +type ListDeletedComputes struct { + // Data + Data []ItemDeletedCompute `json:"data"` + + // EntryCount + EntryCount uint64 `json:"entryCount"` +} + // Short information about audit type ItemAudit struct { // Epoch diff --git a/pkg/cloudbroker/compute/move_to_rg.go b/pkg/cloudbroker/compute/move_to_rg.go index d0f25b1..1747af0 100644 --- a/pkg/cloudbroker/compute/move_to_rg.go +++ b/pkg/cloudbroker/compute/move_to_rg.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MoveToRGRequest struct to move compute to new resource group diff --git a/pkg/cloudbroker/compute/net_attach.go b/pkg/cloudbroker/compute/net_attach.go index 95c9815..0747a94 100644 --- a/pkg/cloudbroker/compute/net_attach.go +++ b/pkg/cloudbroker/compute/net_attach.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NetAttachRequest struct to attach network @@ -32,6 +32,10 @@ type NetAttachRequest struct { // Required: true IPAddr string `url:"ipAddr,omitempty" json:"ipAddr,omitempty"` + // MAC address + // Required: false + MACAddr string `url:"mac_addr,omitempty" json:"mac_addr,omitempty"` + // Used only for DPDK type, must be 1-9216 // Required: false MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"` diff --git a/pkg/cloudbroker/compute/net_detach.go b/pkg/cloudbroker/compute/net_detach.go index 9c498af..bbc0956 100644 --- a/pkg/cloudbroker/compute/net_detach.go +++ b/pkg/cloudbroker/compute/net_detach.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NetDetachRequest struct to detach network from compute diff --git a/pkg/cloudbroker/compute/net_qos.go b/pkg/cloudbroker/compute/net_qos.go index cdae326..dca6a4a 100644 --- a/pkg/cloudbroker/compute/net_qos.go +++ b/pkg/cloudbroker/compute/net_qos.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NetQOSRequest struct for update QOS diff --git a/pkg/cloudbroker/compute/pause.go b/pkg/cloudbroker/compute/pause.go index 65314b9..ef0b55d 100644 --- a/pkg/cloudbroker/compute/pause.go +++ b/pkg/cloudbroker/compute/pause.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PauseRequest struct to pause compute diff --git a/pkg/cloudbroker/compute/pfw_add.go b/pkg/cloudbroker/compute/pfw_add.go index d687c96..43d8b20 100644 --- a/pkg/cloudbroker/compute/pfw_add.go +++ b/pkg/cloudbroker/compute/pfw_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PFWAddRequest struct to add port forward rule diff --git a/pkg/cloudbroker/compute/pfw_del.go b/pkg/cloudbroker/compute/pfw_del.go index f9c0487..f619316 100644 --- a/pkg/cloudbroker/compute/pfw_del.go +++ b/pkg/cloudbroker/compute/pfw_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PFWDelRequest struct to delete port forward rule diff --git a/pkg/cloudbroker/compute/pfw_list.go b/pkg/cloudbroker/compute/pfw_list.go index 8fb50bc..0cd9631 100644 --- a/pkg/cloudbroker/compute/pfw_list.go +++ b/pkg/cloudbroker/compute/pfw_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PFWListRequest struct to get list of port forwards diff --git a/pkg/cloudbroker/compute/pin_to_stack.go b/pkg/cloudbroker/compute/pin_to_stack.go index 93c54f5..f34c589 100644 --- a/pkg/cloudbroker/compute/pin_to_stack.go +++ b/pkg/cloudbroker/compute/pin_to_stack.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PinToStackRequest struct to pin compute to stack diff --git a/pkg/cloudbroker/compute/power_cycle.go b/pkg/cloudbroker/compute/power_cycle.go index 35ec058..ada8474 100644 --- a/pkg/cloudbroker/compute/power_cycle.go +++ b/pkg/cloudbroker/compute/power_cycle.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PowerCycleRequest struct to force stop and start compute diff --git a/pkg/cloudbroker/compute/reboot.go b/pkg/cloudbroker/compute/reboot.go index 76f2896..474565c 100644 --- a/pkg/cloudbroker/compute/reboot.go +++ b/pkg/cloudbroker/compute/reboot.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RebootRequest struct to reboot compute diff --git a/pkg/cloudbroker/compute/redeploy.go b/pkg/cloudbroker/compute/redeploy.go index 3550f2c..ec262a8 100644 --- a/pkg/cloudbroker/compute/redeploy.go +++ b/pkg/cloudbroker/compute/redeploy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RedeployRequest struct for redeploy diff --git a/pkg/cloudbroker/compute/registration.go b/pkg/cloudbroker/compute/registration.go deleted file mode 100644 index 361b409..0000000 --- a/pkg/cloudbroker/compute/registration.go +++ /dev/null @@ -1,42 +0,0 @@ -package compute - -import ( - "context" - "net/http" - "strconv" - - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" -) - -// RegistrationRequest struct to set compute registered in RT -type RegistrationRequest struct { - // ID of the Compute - // Required: true - ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` - - // Unique compute registration key - // Required: true - RegistrationKey string `url:"registrationKey" json:"registrationKey" validate:"required"` -} - -// Registration sets compute registered in RT -func (c Compute) Registration(ctx context.Context, req RegistrationRequest) (bool, error) { - err := validators.ValidateRequest(req) - if err != nil { - return false, validators.ValidationErrors(validators.GetErrors(err)) - } - - url := "/cloudbroker/compute/registration" - - res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) - if err != nil { - return false, err - } - - result, err := strconv.ParseBool(string(res)) - if err != nil { - return false, err - } - - return result, nil -} diff --git a/pkg/cloudbroker/compute/repair_boot_fs.go b/pkg/cloudbroker/compute/repair_boot_fs.go deleted file mode 100644 index ec2dbf2..0000000 --- a/pkg/cloudbroker/compute/repair_boot_fs.go +++ /dev/null @@ -1,38 +0,0 @@ -package compute - -import ( - "context" - "net/http" - "strconv" - - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" -) - -// RepairBootFSRequest struct to repair filesystem -type RepairBootFSRequest struct { - // ID of compute instance - // Required: true - ComputeID uint64 `url:"computeId" json:"computeId" validate:"required"` -} - -// RepairBootFS repairs compute boot disk filesystem -func (c Compute) RepairBootFS(ctx context.Context, req RepairBootFSRequest) (bool, error) { - err := validators.ValidateRequest(req) - if err != nil { - return false, validators.ValidationErrors(validators.GetErrors(err)) - } - - url := "/cloudbroker/compute/repairBootFs" - - res, err := c.client.DecortApiCall(ctx, http.MethodPost, url, req) - if err != nil { - return false, err - } - - result, err := strconv.ParseBool(string(res)) - if err != nil { - return false, err - } - - return result, nil -} diff --git a/pkg/cloudbroker/compute/reset.go b/pkg/cloudbroker/compute/reset.go index a0fa7f0..e42ac45 100644 --- a/pkg/cloudbroker/compute/reset.go +++ b/pkg/cloudbroker/compute/reset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResetRequest struct to reset compute diff --git a/pkg/cloudbroker/compute/resize.go b/pkg/cloudbroker/compute/resize.go index 7d902e1..6fe4f4f 100644 --- a/pkg/cloudbroker/compute/resize.go +++ b/pkg/cloudbroker/compute/resize.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResizeRequest struct to resize compute diff --git a/pkg/cloudbroker/compute/restore.go b/pkg/cloudbroker/compute/restore.go index 4ae045d..85d4d4f 100644 --- a/pkg/cloudbroker/compute/restore.go +++ b/pkg/cloudbroker/compute/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore compute diff --git a/pkg/cloudbroker/compute/resume.go b/pkg/cloudbroker/compute/resume.go index dcffd59..3516076 100644 --- a/pkg/cloudbroker/compute/resume.go +++ b/pkg/cloudbroker/compute/resume.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResumeRequest struct to resume compute diff --git a/pkg/cloudbroker/compute/serialize.go b/pkg/cloudbroker/compute/serialize.go index 00143cb..6b3cd3b 100644 --- a/pkg/cloudbroker/compute/serialize.go +++ b/pkg/cloudbroker/compute/serialize.go @@ -3,7 +3,7 @@ package compute import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/compute/set_custom_fields.go b/pkg/cloudbroker/compute/set_custom_fields.go index 10e70ac..26c189d 100644 --- a/pkg/cloudbroker/compute/set_custom_fields.go +++ b/pkg/cloudbroker/compute/set_custom_fields.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCustomFieldsRequest struct for setting customFields values for the Compute diff --git a/pkg/cloudbroker/compute/set_net_config.go b/pkg/cloudbroker/compute/set_net_config.go index 0439778..dd398ae 100644 --- a/pkg/cloudbroker/compute/set_net_config.go +++ b/pkg/cloudbroker/compute/set_net_config.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetNetConfigRequest struct to Configure libvirt virtio interface parameters diff --git a/pkg/cloudbroker/compute/snapshot_create.go b/pkg/cloudbroker/compute/snapshot_create.go index fe5c5a5..69d1afb 100644 --- a/pkg/cloudbroker/compute/snapshot_create.go +++ b/pkg/cloudbroker/compute/snapshot_create.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotCreateRequest struct to create snapshot diff --git a/pkg/cloudbroker/compute/snapshot_delete.go b/pkg/cloudbroker/compute/snapshot_delete.go index ecba9d8..d98c9e0 100644 --- a/pkg/cloudbroker/compute/snapshot_delete.go +++ b/pkg/cloudbroker/compute/snapshot_delete.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotDeleteRequest struct to delete snapshot diff --git a/pkg/cloudbroker/compute/snapshot_evict_disk.go b/pkg/cloudbroker/compute/snapshot_evict_disk.go index a18a145..031a817 100644 --- a/pkg/cloudbroker/compute/snapshot_evict_disk.go +++ b/pkg/cloudbroker/compute/snapshot_evict_disk.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotEvictDiskRequest struct to evict specified disk diff --git a/pkg/cloudbroker/compute/snapshot_list.go b/pkg/cloudbroker/compute/snapshot_list.go index e5d4c1a..a8d4756 100644 --- a/pkg/cloudbroker/compute/snapshot_list.go +++ b/pkg/cloudbroker/compute/snapshot_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotListRequest struct to get list of snapshots diff --git a/pkg/cloudbroker/compute/snapshot_rollback.go b/pkg/cloudbroker/compute/snapshot_rollback.go index ffc5c5f..81d3749 100644 --- a/pkg/cloudbroker/compute/snapshot_rollback.go +++ b/pkg/cloudbroker/compute/snapshot_rollback.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotRollbackRequest struct for rollback diff --git a/pkg/cloudbroker/compute/snapshot_usage.go b/pkg/cloudbroker/compute/snapshot_usage.go index 6b3d5b5..ab6ec73 100644 --- a/pkg/cloudbroker/compute/snapshot_usage.go +++ b/pkg/cloudbroker/compute/snapshot_usage.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotUsageRequest struct tto get compute snapshot real size on storage diff --git a/pkg/cloudbroker/compute/sorting.go b/pkg/cloudbroker/compute/sorting.go index b244d55..e78e578 100644 --- a/pkg/cloudbroker/compute/sorting.go +++ b/pkg/cloudbroker/compute/sorting.go @@ -96,3 +96,98 @@ func (lc ListComputes) SortByDeletedTime(inverse bool) ListComputes { return lc } + +// SortByCPU sorts ListDeletedComputes by the CPU core amount in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lc ListDeletedComputes) SortByCPU(inverse bool) ListDeletedComputes { + if len(lc.Data) < 2 { + return lc + } + + sort.Slice(lc.Data, func(i, j int) bool { + if inverse { + return lc.Data[i].CPUs > lc.Data[j].CPUs + } + + return lc.Data[i].CPUs < lc.Data[j].CPUs + }) + + return lc +} + +// SortByRAM sorts ListDeletedComputes by the RAM amount in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lc ListDeletedComputes) SortByRAM(inverse bool) ListDeletedComputes { + if len(lc.Data) < 2 { + return lc + } + + sort.Slice(lc.Data, func(i, j int) bool { + if inverse { + return lc.Data[i].RAM > lc.Data[j].RAM + } + + return lc.Data[i].RAM < lc.Data[j].RAM + }) + + return lc +} + +// SortByCreatedTime sorts ListDeletedComputes by the CreatedTime field in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lc ListDeletedComputes) SortByCreatedTime(inverse bool) ListDeletedComputes { + if len(lc.Data) < 2 { + return lc + } + + sort.Slice(lc.Data, func(i, j int) bool { + if inverse { + return lc.Data[i].CreatedTime > lc.Data[j].CreatedTime + } + + return lc.Data[i].CreatedTime < lc.Data[j].CreatedTime + }) + + return lc +} + +// SortByUpdatedTime sorts ListDeletedComputes by the UpdatedTime field in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lc ListDeletedComputes) SortByUpdatedTime(inverse bool) ListDeletedComputes { + if len(lc.Data) < 2 { + return lc + } + + sort.Slice(lc.Data, func(i, j int) bool { + if inverse { + return lc.Data[i].UpdatedTime > lc.Data[j].UpdatedTime + } + + return lc.Data[i].UpdatedTime < lc.Data[j].UpdatedTime + }) + + return lc +} + +// SortByDeletedTime sorts ListDeletedComputes by the DeletedTime field in ascending order. +// +// If inverse param is set to true, the order is reversed. +func (lc ListDeletedComputes) SortByDeletedTime(inverse bool) ListDeletedComputes { + if len(lc.Data) < 2 { + return lc + } + + sort.Slice(lc.Data, func(i, j int) bool { + if inverse { + return lc.Data[i].DeletedTime > lc.Data[j].DeletedTime + } + + return lc.Data[i].DeletedTime < lc.Data[j].DeletedTime + }) + + return lc +} diff --git a/pkg/cloudbroker/compute/start.go b/pkg/cloudbroker/compute/start.go index 6c0c963..4d2e922 100644 --- a/pkg/cloudbroker/compute/start.go +++ b/pkg/cloudbroker/compute/start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StartRequest struct to start compute diff --git a/pkg/cloudbroker/compute/stop.go b/pkg/cloudbroker/compute/stop.go index 10fbe58..352850f 100644 --- a/pkg/cloudbroker/compute/stop.go +++ b/pkg/cloudbroker/compute/stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StopRequest struct to stop compute @@ -17,11 +17,6 @@ type StopRequest struct { // Force stop compute // Required: false Force bool `url:"force,omitempty" json:"force,omitempty"` - - // whether to depresent compute disks from node or not - // Default: true - // Required: false - Depresent bool `url:"depresent" json:"depresent"` } // Stop stops compute diff --git a/pkg/cloudbroker/compute/tag_add.go b/pkg/cloudbroker/compute/tag_add.go index 10f3468..cb670f5 100644 --- a/pkg/cloudbroker/compute/tag_add.go +++ b/pkg/cloudbroker/compute/tag_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // TagAddRequest struct to add tag to compute diff --git a/pkg/cloudbroker/compute/tag_remove.go b/pkg/cloudbroker/compute/tag_remove.go index bf65759..38c9953 100644 --- a/pkg/cloudbroker/compute/tag_remove.go +++ b/pkg/cloudbroker/compute/tag_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // TagRemoveRequest struct to remove tag from compute diff --git a/pkg/cloudbroker/compute/unpin_from_stack.go b/pkg/cloudbroker/compute/unpin_from_stack.go index cb553ad..ef96cd9 100644 --- a/pkg/cloudbroker/compute/unpin_from_stack.go +++ b/pkg/cloudbroker/compute/unpin_from_stack.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UnpinFromStackRequest struct to unpin from stack diff --git a/pkg/cloudbroker/compute/update.go b/pkg/cloudbroker/compute/update.go index 645e557..635bc04 100644 --- a/pkg/cloudbroker/compute/update.go +++ b/pkg/cloudbroker/compute/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update compute @@ -30,28 +30,41 @@ type UpdateRequest struct { // Default: none NumaAffinity string `url:"numaAffinity,omitempty" json:"numaAffinity,omitempty" validate:"omitempty,numaAffinity"` - // Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node + // Run VM on dedicated CPUs. To use this feature, the system must be pre-configured by allocating CPUs on the physical node, true or false // Required: false - // Default: false - CPUPin bool `url:"cpupin" json:"cpupin"` + CPUPin interface{} `url:"cpupin,omitempty" json:"cpupin,omitempty" validate:"omitempty,isBool"` // Type of the emulated system, Q35 or i440fx // Required: false Chipset string `url:"chipset,omitempty" json:"chipset,omitempty" validate:"omitempty,chipset"` - // Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node + // Use Huge Pages to allocate RAM of the virtual machine. The system must be pre-configured by allocating Huge Pages on the physical node, true or false // Required: false - // Default: false - HPBacked bool `url:"hpBacked" json:"hpBacked"` + HPBacked interface{} `url:"hpBacked,omitempty" json:"hpBacked,omitempty" validate:"omitempty,isBool"` - // Auto start when node restarted + // Auto start when node restarted, true or false // Required: false - // Default: false - AutoStart bool `url:"autoStart" json:"autoStart"` + AutoStart interface{} `url:"autoStart,omitempty" json:"autoStart,omitempty" validate:"omitempty,isBool"` // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False // Required: false PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"` + + // VM type linux, windows or unknown + // Required: false + LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"` + + // Boot type of image bios or uefi + // Required: false + BootType string `url:"bootType,omitempty" json:"bootType,omitempty" validate:"omitempty,imageBootType"` + + // Select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming. + // Required: false + NetworkInterfaceNaming string `url:"networkInterfaceNaming,omitempty" json:"networkInterfaceNaming,omitempty" validate:"omitempty,networkInterfaceNaming"` + + // Does this machine supports hot resize, true or false + // Required: false + HotResize interface{} `url:"hotResize,omitempty" json:"hotResize,omitempty" validate:"omitempty,isBool"` } // Update updates some properties of the compute diff --git a/pkg/cloudbroker/compute/user_grant.go b/pkg/cloudbroker/compute/user_grant.go index 4d76a33..b908f15 100644 --- a/pkg/cloudbroker/compute/user_grant.go +++ b/pkg/cloudbroker/compute/user_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserGrantRequest struct to grant access to compute diff --git a/pkg/cloudbroker/compute/user_list.go b/pkg/cloudbroker/compute/user_list.go index 43d1f55..49ea874 100644 --- a/pkg/cloudbroker/compute/user_list.go +++ b/pkg/cloudbroker/compute/user_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserListRequest struct to get list of users for compute diff --git a/pkg/cloudbroker/compute/user_revoke.go b/pkg/cloudbroker/compute/user_revoke.go index c5a0f7e..b2a593f 100644 --- a/pkg/cloudbroker/compute/user_revoke.go +++ b/pkg/cloudbroker/compute/user_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserRevokeRequest struct to revoke user access diff --git a/pkg/cloudbroker/compute/user_update.go b/pkg/cloudbroker/compute/user_update.go index e8b50e5..41c5e7d 100644 --- a/pkg/cloudbroker/compute/user_update.go +++ b/pkg/cloudbroker/compute/user_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UserUpdateRequest struct to update user access diff --git a/pkg/cloudbroker/disks.go b/pkg/cloudbroker/disks.go index 959fcae..a27e3ab 100644 --- a/pkg/cloudbroker/disks.go +++ b/pkg/cloudbroker/disks.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/disks" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/disks" ) // Accessing the Disks method group diff --git a/pkg/cloudbroker/disks/create.go b/pkg/cloudbroker/disks/create.go index d91e43d..37e74c3 100644 --- a/pkg/cloudbroker/disks/create.go +++ b/pkg/cloudbroker/disks/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create disk @@ -14,10 +14,6 @@ type CreateRequest struct { // Required: true AccountID uint64 `url:"accountId" json:"accountId" validate:"required"` - // ID of the grid (platform) - // Required: true - GID uint64 `url:"gid" json:"gid" validate:"required"` - // Name of disk // Required: true Name string `url:"name" json:"name" validate:"required"` @@ -30,17 +26,6 @@ type CreateRequest struct { // Required: false Size uint64 `url:"size,omitempty" json:"size,omitempty"` - // Type of disk - // - B=Boot - // - D=Data - // - T=Temp - // Required: true - Type string `url:"type" json:"type" validate:"diskType"` - - // Size in GB default is 0 - // Required: false - SSDSize uint64 `url:"ssdSize,omitempty" json:"ssdSize,omitempty"` - // Max IOPS disk can perform defaults to 2000 // Required: false IOPS uint64 `url:"iops,omitempty" json:"iops,omitempty"` diff --git a/pkg/cloudbroker/disks/delete.go b/pkg/cloudbroker/disks/delete.go index 4c36476..9859c2c 100644 --- a/pkg/cloudbroker/disks/delete.go +++ b/pkg/cloudbroker/disks/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete disk @@ -21,6 +21,10 @@ type DeleteRequest struct { // Whether to completely delete the disk, works only with non attached disks // Required: false Permanently bool `url:"permanently,omitempty" json:"permanently,omitempty"` + + // Name of disk to delete + // Required: false + Name string `url:"name,omitempty" json:"name,omitempty"` } // Delete deletes disk by ID diff --git a/pkg/cloudbroker/disks/delete_disks.go b/pkg/cloudbroker/disks/delete_disks.go index b67c5d6..9316995 100644 --- a/pkg/cloudbroker/disks/delete_disks.go +++ b/pkg/cloudbroker/disks/delete_disks.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteDisksRequest struct for multiple disks diff --git a/pkg/cloudbroker/disks/depresent.go b/pkg/cloudbroker/disks/depresent.go index f3e553d..9099e2f 100644 --- a/pkg/cloudbroker/disks/depresent.go +++ b/pkg/cloudbroker/disks/depresent.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DepresentRequest struct to depresent disk from node diff --git a/pkg/cloudbroker/disks/disks.go b/pkg/cloudbroker/disks/disks.go index 37fce55..4612836 100644 --- a/pkg/cloudbroker/disks/disks.go +++ b/pkg/cloudbroker/disks/disks.go @@ -1,7 +1,7 @@ // API Actor for managing Disk. This actor is a final API for admin to manage Disk package disks -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to disks type Disks struct { diff --git a/pkg/cloudbroker/disks/filter.go b/pkg/cloudbroker/disks/filter.go index a870e14..7e742ce 100644 --- a/pkg/cloudbroker/disks/filter.go +++ b/pkg/cloudbroker/disks/filter.go @@ -4,9 +4,9 @@ import ( "context" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/k8s" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/lb" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/lb" ) // FilterByID returns ListDisks with specified ID. diff --git a/pkg/cloudbroker/disks/filter_test.go b/pkg/cloudbroker/disks/filter_test.go index b84d636..c31e65a 100644 --- a/pkg/cloudbroker/disks/filter_test.go +++ b/pkg/cloudbroker/disks/filter_test.go @@ -5,11 +5,12 @@ import "testing" var disks = ListDisks{ Data: []ItemDisk{ { - MachineID: 0, - MachineName: "", + RecordDisk: RecordDisk{ - DeviceName: "vda", - SEPType: "", + MachineID: 0, + MachineName: "", + DeviceName: "vda", + SEPType: "", InfoDisk: InfoDisk{ AccountID: 132847, AccountName: "std_2", @@ -41,9 +42,9 @@ var disks = ListDisks{ Password: "", PCISlot: 6, Pool: "vmstor", - PresentTo: []uint64{ - 27, - }, + //PresentTo: []uint64{ + // 27, + //}, PurgeAttempts: 0, PurgeTime: 0, RealityDeviceNumber: 0, @@ -64,11 +65,12 @@ var disks = ListDisks{ }, }, { - MachineID: 0, - MachineName: "", + RecordDisk: RecordDisk{ - DeviceName: "vda", - SEPType: "", + MachineID: 0, + MachineName: "", + DeviceName: "vda", + SEPType: "", InfoDisk: InfoDisk{ AccountID: 132852, AccountName: "std", @@ -100,10 +102,10 @@ var disks = ListDisks{ Password: "", PCISlot: 6, Pool: "vmstor", - PresentTo: []uint64{ - 27, - 27, - }, + //PresentTo: []uint64{ + // 27, + // 27, + //}, PurgeAttempts: 0, PurgeTime: 0, RealityDeviceNumber: 0, diff --git a/pkg/cloudbroker/disks/from_platform_disk.go b/pkg/cloudbroker/disks/from_platform_disk.go index 2380fc5..c889f0e 100644 --- a/pkg/cloudbroker/disks/from_platform_disk.go +++ b/pkg/cloudbroker/disks/from_platform_disk.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FromPlatformDiskRequest struct to create template from platform disk @@ -45,10 +45,6 @@ type FromPlatformDiskRequest struct { // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` - // SEP ID - // Required: false - SepID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"` - // Pool for image create // Required: false PoolName string `url:"poolName,omitempty" json:"poolName,omitempty"` diff --git a/pkg/cloudbroker/disks/get.go b/pkg/cloudbroker/disks/get.go index 2656dd1..cb54fb5 100644 --- a/pkg/cloudbroker/disks/get.go +++ b/pkg/cloudbroker/disks/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about disk diff --git a/pkg/cloudbroker/disks/limit_io.go b/pkg/cloudbroker/disks/limit_io.go index 7f4e635..c35ca19 100644 --- a/pkg/cloudbroker/disks/limit_io.go +++ b/pkg/cloudbroker/disks/limit_io.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // LimitIORequest struct for limit IO diff --git a/pkg/cloudbroker/disks/list.go b/pkg/cloudbroker/disks/list.go index 7a94fd4..9898a16 100644 --- a/pkg/cloudbroker/disks/list.go +++ b/pkg/cloudbroker/disks/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list/list_deleted of disks diff --git a/pkg/cloudbroker/disks/list_deleted.go b/pkg/cloudbroker/disks/list_deleted.go index 80c073a..75d13c9 100644 --- a/pkg/cloudbroker/disks/list_deleted.go +++ b/pkg/cloudbroker/disks/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted disks diff --git a/pkg/cloudbroker/disks/list_types.go b/pkg/cloudbroker/disks/list_types.go index 417c5dd..93652e2 100644 --- a/pkg/cloudbroker/disks/list_types.go +++ b/pkg/cloudbroker/disks/list_types.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListTypesRequest struct to get list of types of disks diff --git a/pkg/cloudbroker/disks/list_unattached.go b/pkg/cloudbroker/disks/list_unattached.go index 3a53099..b555813 100644 --- a/pkg/cloudbroker/disks/list_unattached.go +++ b/pkg/cloudbroker/disks/list_unattached.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListUnattachedRequest struct to get list of unattached disk diff --git a/pkg/cloudbroker/disks/models.go b/pkg/cloudbroker/disks/models.go index 6381751..d3791d6 100644 --- a/pkg/cloudbroker/disks/models.go +++ b/pkg/cloudbroker/disks/models.go @@ -123,7 +123,7 @@ type InfoDisk struct { Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Purge attempts PurgeAttempts uint64 `json:"purgeAttempts"` @@ -155,6 +155,9 @@ type InfoDisk struct { // Shareable Shareable bool `json:"shareable"` + // Size available + SizeAvailable float64 `json:"sizeAvailable"` + // Size max SizeMax int64 `json:"sizeMax"` @@ -175,6 +178,9 @@ type InfoDisk struct { // Virtual machine ID VMID uint64 `json:"vmid"` + + // Updated by + UpdatedBy string `json:"updatedBy"` } type ItemReplication struct { @@ -199,23 +205,37 @@ type ItemReplication struct { // Detailed indormation about disk type RecordDisk struct { + + //Created by + CreatedBy string `json:"createdBy"` + + //Deleted by + DeletedBy string `json:"deletedBy"` + // Device name DeviceName string `json:"devicename"` // SEP type SEPType string `json:"sepType"` + // Machine ID + MachineID uint64 `json:"machineId"` + + // Machine name + MachineName string `json:"machineName"` + // Main information about disk InfoDisk + + //Updated by + UpdatedBy string `json:"updatedBy"` + + // Update time + UpdatedTime uint64 `json:"updatedTime"` } // Main information for list disks type ItemDisk struct { - // Machine ID - MachineID uint64 `json:"machineId"` - - // Machine name - MachineName string `json:"machineName"` // Detailed information about disk RecordDisk diff --git a/pkg/cloudbroker/disks/present.go b/pkg/cloudbroker/disks/present.go index 3dd0041..18db0fb 100644 --- a/pkg/cloudbroker/disks/present.go +++ b/pkg/cloudbroker/disks/present.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PresentRequest struct to present disk to node diff --git a/pkg/cloudbroker/disks/rename.go b/pkg/cloudbroker/disks/rename.go index 0df03fc..24b9509 100644 --- a/pkg/cloudbroker/disks/rename.go +++ b/pkg/cloudbroker/disks/rename.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RenameRequest struct to rename disk diff --git a/pkg/cloudbroker/disks/replicate.go b/pkg/cloudbroker/disks/replicate.go index f76ee94..a170a1c 100644 --- a/pkg/cloudbroker/disks/replicate.go +++ b/pkg/cloudbroker/disks/replicate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicateRequest struct to create an empty disk in chosen SEP and pool combination. diff --git a/pkg/cloudbroker/disks/replication_resume.go b/pkg/cloudbroker/disks/replication_resume.go index 91ac903..cbf605f 100644 --- a/pkg/cloudbroker/disks/replication_resume.go +++ b/pkg/cloudbroker/disks/replication_resume.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationResume struct to resume suspended replication diff --git a/pkg/cloudbroker/disks/replication_reverse.go b/pkg/cloudbroker/disks/replication_reverse.go index 8fb8dcf..554ac9a 100644 --- a/pkg/cloudbroker/disks/replication_reverse.go +++ b/pkg/cloudbroker/disks/replication_reverse.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationReverseRequest struct to change role between disks replications diff --git a/pkg/cloudbroker/disks/replication_start.go b/pkg/cloudbroker/disks/replication_start.go index 9171128..fd7acbc 100644 --- a/pkg/cloudbroker/disks/replication_start.go +++ b/pkg/cloudbroker/disks/replication_start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationStartRequest struct to starts replication between two chosen disks diff --git a/pkg/cloudbroker/disks/replication_status.go b/pkg/cloudbroker/disks/replication_status.go index ae64502..d51a932 100644 --- a/pkg/cloudbroker/disks/replication_status.go +++ b/pkg/cloudbroker/disks/replication_status.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationStatusRequest struct to get replication status diff --git a/pkg/cloudbroker/disks/replication_stop.go b/pkg/cloudbroker/disks/replication_stop.go index 6007dc6..02dab1a 100644 --- a/pkg/cloudbroker/disks/replication_stop.go +++ b/pkg/cloudbroker/disks/replication_stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationStopRequest struct to remove replication between disks completely diff --git a/pkg/cloudbroker/disks/replication_suspend.go b/pkg/cloudbroker/disks/replication_suspend.go index 3591b5b..4242c9d 100644 --- a/pkg/cloudbroker/disks/replication_suspend.go +++ b/pkg/cloudbroker/disks/replication_suspend.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ReplicationSuspendRequest struct to pause replication with possibility to resume from pause moment diff --git a/pkg/cloudbroker/disks/resize.go b/pkg/cloudbroker/disks/resize.go index 70bbbbc..0614ac1 100644 --- a/pkg/cloudbroker/disks/resize.go +++ b/pkg/cloudbroker/disks/resize.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ResizeRequest struct to resize disk diff --git a/pkg/cloudbroker/disks/restore.go b/pkg/cloudbroker/disks/restore.go index fb820c4..3bc2cd4 100644 --- a/pkg/cloudbroker/disks/restore.go +++ b/pkg/cloudbroker/disks/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore a deleted unattached disk diff --git a/pkg/cloudbroker/disks/serialize.go b/pkg/cloudbroker/disks/serialize.go index 8414fa4..8b015ea 100644 --- a/pkg/cloudbroker/disks/serialize.go +++ b/pkg/cloudbroker/disks/serialize.go @@ -3,7 +3,7 @@ package disks import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/disks/share.go b/pkg/cloudbroker/disks/share.go index 0f9126d..3609c4c 100644 --- a/pkg/cloudbroker/disks/share.go +++ b/pkg/cloudbroker/disks/share.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ShareRequest struct to share data disk diff --git a/pkg/cloudbroker/disks/snapshot_delete.go b/pkg/cloudbroker/disks/snapshot_delete.go index 24140d3..3cc5118 100644 --- a/pkg/cloudbroker/disks/snapshot_delete.go +++ b/pkg/cloudbroker/disks/snapshot_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotDeleteRequest struct to delete snapshot diff --git a/pkg/cloudbroker/disks/snapshot_rollback.go b/pkg/cloudbroker/disks/snapshot_rollback.go index 83b6fd3..db6bfdb 100644 --- a/pkg/cloudbroker/disks/snapshot_rollback.go +++ b/pkg/cloudbroker/disks/snapshot_rollback.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SnapshotRollbackRequest struct to rollback snapshot diff --git a/pkg/cloudbroker/disks/unshare.go b/pkg/cloudbroker/disks/unshare.go index d1f0329..93e3f9b 100644 --- a/pkg/cloudbroker/disks/unshare.go +++ b/pkg/cloudbroker/disks/unshare.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UnshareRequest struct to unshare data disk diff --git a/pkg/cloudbroker/dpdk.go b/pkg/cloudbroker/dpdk.go index a137cdd..4c0a6a9 100644 --- a/pkg/cloudbroker/dpdk.go +++ b/pkg/cloudbroker/dpdk.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/dpdknet" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/dpdknet" // Accessing the DPDK method group func (ca *CloudBroker) DPDKNet() *dpdknet.DPDKNet { diff --git a/pkg/cloudbroker/dpdknet/create.go b/pkg/cloudbroker/dpdknet/create.go index 7da7801..db4bd4e 100644 --- a/pkg/cloudbroker/dpdknet/create.go +++ b/pkg/cloudbroker/dpdknet/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create DPDK network diff --git a/pkg/cloudbroker/dpdknet/delete.go b/pkg/cloudbroker/dpdknet/delete.go index 4b450fb..64cab18 100644 --- a/pkg/cloudbroker/dpdknet/delete.go +++ b/pkg/cloudbroker/dpdknet/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete DPDK network diff --git a/pkg/cloudbroker/dpdknet/disable.go b/pkg/cloudbroker/dpdknet/disable.go index 8380c60..9e546b9 100644 --- a/pkg/cloudbroker/dpdknet/disable.go +++ b/pkg/cloudbroker/dpdknet/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable DPDK network diff --git a/pkg/cloudbroker/dpdknet/dpdk.go b/pkg/cloudbroker/dpdknet/dpdk.go index 8b301fa..0d2500f 100644 --- a/pkg/cloudbroker/dpdknet/dpdk.go +++ b/pkg/cloudbroker/dpdknet/dpdk.go @@ -1,6 +1,6 @@ package dpdknet -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to DPDK network type DPDKNet struct { diff --git a/pkg/cloudbroker/dpdknet/enable.go b/pkg/cloudbroker/dpdknet/enable.go index 3b40fab..a658815 100644 --- a/pkg/cloudbroker/dpdknet/enable.go +++ b/pkg/cloudbroker/dpdknet/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable DPDK network diff --git a/pkg/cloudbroker/dpdknet/get.go b/pkg/cloudbroker/dpdknet/get.go index a3d74c1..1d7d329 100644 --- a/pkg/cloudbroker/dpdknet/get.go +++ b/pkg/cloudbroker/dpdknet/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about DPDK network diff --git a/pkg/cloudbroker/dpdknet/list.go b/pkg/cloudbroker/dpdknet/list.go index e0a887e..7d4be00 100644 --- a/pkg/cloudbroker/dpdknet/list.go +++ b/pkg/cloudbroker/dpdknet/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of DPDK networks diff --git a/pkg/cloudbroker/dpdknet/update.go b/pkg/cloudbroker/dpdknet/update.go index e5e3636..1e7d75a 100644 --- a/pkg/cloudbroker/dpdknet/update.go +++ b/pkg/cloudbroker/dpdknet/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update DPDK network diff --git a/pkg/cloudbroker/extnet.go b/pkg/cloudbroker/extnet.go index 4e28160..3b59a96 100644 --- a/pkg/cloudbroker/extnet.go +++ b/pkg/cloudbroker/extnet.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/extnet" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/extnet" ) // Accessing the ExtNet method group diff --git a/pkg/cloudbroker/extnet/access_add.go b/pkg/cloudbroker/extnet/access_add.go index bdf6bff..2a179ba 100644 --- a/pkg/cloudbroker/extnet/access_add.go +++ b/pkg/cloudbroker/extnet/access_add.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessAddRequest struct to grant access diff --git a/pkg/cloudbroker/extnet/access_remove.go b/pkg/cloudbroker/extnet/access_remove.go index b678bf0..4c73d2b 100644 --- a/pkg/cloudbroker/extnet/access_remove.go +++ b/pkg/cloudbroker/extnet/access_remove.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessRemoveRequest struct to remove access diff --git a/pkg/cloudbroker/extnet/add_reserved_ip.go b/pkg/cloudbroker/extnet/add_reserved_ip.go index f81050b..c549216 100644 --- a/pkg/cloudbroker/extnet/add_reserved_ip.go +++ b/pkg/cloudbroker/extnet/add_reserved_ip.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddReserveIPRequest struct to reserved address or address poll diff --git a/pkg/cloudbroker/extnet/create.go b/pkg/cloudbroker/extnet/create.go index ac80039..b30bba4 100644 --- a/pkg/cloudbroker/extnet/create.go +++ b/pkg/cloudbroker/extnet/create.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type Route struct { diff --git a/pkg/cloudbroker/extnet/default_qos_update.go b/pkg/cloudbroker/extnet/default_qos_update.go index 64600e6..a570d26 100644 --- a/pkg/cloudbroker/extnet/default_qos_update.go +++ b/pkg/cloudbroker/extnet/default_qos_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DefaultQOSUpdateRequest struct for update QOS diff --git a/pkg/cloudbroker/extnet/del_reserved_ip.go b/pkg/cloudbroker/extnet/del_reserved_ip.go index fa3f01f..7db9b18 100644 --- a/pkg/cloudbroker/extnet/del_reserved_ip.go +++ b/pkg/cloudbroker/extnet/del_reserved_ip.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DelReserveIPRequest struct to delete reserved address or address poll diff --git a/pkg/cloudbroker/extnet/destroy.go b/pkg/cloudbroker/extnet/destroy.go index ba07578..d9396fc 100644 --- a/pkg/cloudbroker/extnet/destroy.go +++ b/pkg/cloudbroker/extnet/destroy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DestroyRequest struct for destroy diff --git a/pkg/cloudbroker/extnet/device_deploy.go b/pkg/cloudbroker/extnet/device_deploy.go index 04ca988..55116e0 100644 --- a/pkg/cloudbroker/extnet/device_deploy.go +++ b/pkg/cloudbroker/extnet/device_deploy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeviceDeployRequest struct to deploy network device diff --git a/pkg/cloudbroker/extnet/device_migrate.go b/pkg/cloudbroker/extnet/device_migrate.go index bff05cd..8ee4dbc 100644 --- a/pkg/cloudbroker/extnet/device_migrate.go +++ b/pkg/cloudbroker/extnet/device_migrate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeviceMigrateRequest struct for migrate VNF diff --git a/pkg/cloudbroker/extnet/device_remove.go b/pkg/cloudbroker/extnet/device_remove.go index df1de89..b8bdb7f 100644 --- a/pkg/cloudbroker/extnet/device_remove.go +++ b/pkg/cloudbroker/extnet/device_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeviceRemoveRequest struct to remove network device diff --git a/pkg/cloudbroker/extnet/device_restart.go b/pkg/cloudbroker/extnet/device_restart.go index 5f38f3d..4d161bf 100644 --- a/pkg/cloudbroker/extnet/device_restart.go +++ b/pkg/cloudbroker/extnet/device_restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeviceRestartRequest struct for restart VNF device diff --git a/pkg/cloudbroker/extnet/disable.go b/pkg/cloudbroker/extnet/disable.go index 997adf7..c7ab6f6 100644 --- a/pkg/cloudbroker/extnet/disable.go +++ b/pkg/cloudbroker/extnet/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable external network diff --git a/pkg/cloudbroker/extnet/dns_apply.go b/pkg/cloudbroker/extnet/dns_apply.go index 8a0ccf0..da14f96 100644 --- a/pkg/cloudbroker/extnet/dns_apply.go +++ b/pkg/cloudbroker/extnet/dns_apply.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DNSApplyRequest struct to set new DNS diff --git a/pkg/cloudbroker/extnet/enable.go b/pkg/cloudbroker/extnet/enable.go index af02d13..a95aafc 100644 --- a/pkg/cloudbroker/extnet/enable.go +++ b/pkg/cloudbroker/extnet/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable external network diff --git a/pkg/cloudbroker/extnet/extnet.go b/pkg/cloudbroker/extnet/extnet.go index ba166c0..9db89c4 100644 --- a/pkg/cloudbroker/extnet/extnet.go +++ b/pkg/cloudbroker/extnet/extnet.go @@ -1,7 +1,7 @@ // API Actor for configure and use external networks package extnet -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to extnet type ExtNet struct { diff --git a/pkg/cloudbroker/extnet/get.go b/pkg/cloudbroker/extnet/get.go index 652aa4d..4427513 100644 --- a/pkg/cloudbroker/extnet/get.go +++ b/pkg/cloudbroker/extnet/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about external network diff --git a/pkg/cloudbroker/extnet/get_reserved_ip.go b/pkg/cloudbroker/extnet/get_reserved_ip.go index fca647f..8b6445b 100644 --- a/pkg/cloudbroker/extnet/get_reserved_ip.go +++ b/pkg/cloudbroker/extnet/get_reserved_ip.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about reserved address or address poll diff --git a/pkg/cloudbroker/extnet/ips_exclude.go b/pkg/cloudbroker/extnet/ips_exclude.go index e6989f8..8a218cf 100644 --- a/pkg/cloudbroker/extnet/ips_exclude.go +++ b/pkg/cloudbroker/extnet/ips_exclude.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPsExcludeRequest struct to exclude list of IPs diff --git a/pkg/cloudbroker/extnet/ips_exclude_range.go b/pkg/cloudbroker/extnet/ips_exclude_range.go index 9f1025f..f77ae25 100644 --- a/pkg/cloudbroker/extnet/ips_exclude_range.go +++ b/pkg/cloudbroker/extnet/ips_exclude_range.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPsExcludeRangeRequest struct to exclude range of IPs diff --git a/pkg/cloudbroker/extnet/ips_include.go b/pkg/cloudbroker/extnet/ips_include.go index 6f5d598..5acc80f 100644 --- a/pkg/cloudbroker/extnet/ips_include.go +++ b/pkg/cloudbroker/extnet/ips_include.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPsIncludeRequest struct to include list of IPs diff --git a/pkg/cloudbroker/extnet/ips_include_range.go b/pkg/cloudbroker/extnet/ips_include_range.go index 867e412..a6bc01b 100644 --- a/pkg/cloudbroker/extnet/ips_include_range.go +++ b/pkg/cloudbroker/extnet/ips_include_range.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPsIncludeRangeRequest struct to include range of IPs diff --git a/pkg/cloudbroker/extnet/list.go b/pkg/cloudbroker/extnet/list.go index c197698..1a180dc 100644 --- a/pkg/cloudbroker/extnet/list.go +++ b/pkg/cloudbroker/extnet/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of external network diff --git a/pkg/cloudbroker/extnet/models.go b/pkg/cloudbroker/extnet/models.go index 56885b9..645b5d4 100644 --- a/pkg/cloudbroker/extnet/models.go +++ b/pkg/cloudbroker/extnet/models.go @@ -184,6 +184,9 @@ type RecordExtNet struct { // Network ID NetworkID uint64 `json:"networkId"` + // NTP + NTP []string `json:"ntp"` + // OVSBridge OVSBridge string `json:"ovsBridge"` diff --git a/pkg/cloudbroker/extnet/ntp_apply.go b/pkg/cloudbroker/extnet/ntp_apply.go index d7090e9..b993e88 100644 --- a/pkg/cloudbroker/extnet/ntp_apply.go +++ b/pkg/cloudbroker/extnet/ntp_apply.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NTPApplyRequest struct for set new NTP diff --git a/pkg/cloudbroker/extnet/serialize.go b/pkg/cloudbroker/extnet/serialize.go index 0e05108..7f9e486 100644 --- a/pkg/cloudbroker/extnet/serialize.go +++ b/pkg/cloudbroker/extnet/serialize.go @@ -3,7 +3,7 @@ package extnet import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/extnet/set_default.go b/pkg/cloudbroker/extnet/set_default.go index 6ff9a8d..5c435ca 100644 --- a/pkg/cloudbroker/extnet/set_default.go +++ b/pkg/cloudbroker/extnet/set_default.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetDefaultRequest struct to set external network as default diff --git a/pkg/cloudbroker/extnet/static_route_access_grant.go b/pkg/cloudbroker/extnet/static_route_access_grant.go index 6acc470..c9d43b5 100644 --- a/pkg/cloudbroker/extnet/static_route_access_grant.go +++ b/pkg/cloudbroker/extnet/static_route_access_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAccessGrantRequest struct to grant access to static route to Compute/ViNS diff --git a/pkg/cloudbroker/extnet/static_route_access_revoke.go b/pkg/cloudbroker/extnet/static_route_access_revoke.go index 8232b3f..c0e68fd 100644 --- a/pkg/cloudbroker/extnet/static_route_access_revoke.go +++ b/pkg/cloudbroker/extnet/static_route_access_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAccessRevokeRequest struct to revoke access to static route to Compute/ViNS diff --git a/pkg/cloudbroker/extnet/static_route_add.go b/pkg/cloudbroker/extnet/static_route_add.go index 3dc517f..ab4cdcc 100644 --- a/pkg/cloudbroker/extnet/static_route_add.go +++ b/pkg/cloudbroker/extnet/static_route_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAddRequest struct to add static route diff --git a/pkg/cloudbroker/extnet/static_route_del.go b/pkg/cloudbroker/extnet/static_route_del.go index 5b1c7e4..3833321 100644 --- a/pkg/cloudbroker/extnet/static_route_del.go +++ b/pkg/cloudbroker/extnet/static_route_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteDelRequest struct to remove static route from ViNS diff --git a/pkg/cloudbroker/extnet/static_route_list.go b/pkg/cloudbroker/extnet/static_route_list.go index ec8957c..ddc0912 100644 --- a/pkg/cloudbroker/extnet/static_route_list.go +++ b/pkg/cloudbroker/extnet/static_route_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteListRequest struct for static route list diff --git a/pkg/cloudbroker/extnet/update.go b/pkg/cloudbroker/extnet/update.go index 059b7da..3667af5 100644 --- a/pkg/cloudbroker/extnet/update.go +++ b/pkg/cloudbroker/extnet/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update external network diff --git a/pkg/cloudbroker/flipgoup.go b/pkg/cloudbroker/flipgoup.go index 96dd5b1..c786cc0 100644 --- a/pkg/cloudbroker/flipgoup.go +++ b/pkg/cloudbroker/flipgoup.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/flipgroup" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/flipgroup" ) // Accessing the FLIPGroup method group diff --git a/pkg/cloudbroker/flipgroup/compute_add.go b/pkg/cloudbroker/flipgroup/compute_add.go index 81ab33e..f400ee5 100644 --- a/pkg/cloudbroker/flipgroup/compute_add.go +++ b/pkg/cloudbroker/flipgroup/compute_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeAddRequest struct to add compute instance diff --git a/pkg/cloudbroker/flipgroup/compute_remove.go b/pkg/cloudbroker/flipgroup/compute_remove.go index 343a8e4..ad84e0c 100644 --- a/pkg/cloudbroker/flipgroup/compute_remove.go +++ b/pkg/cloudbroker/flipgroup/compute_remove.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeRemoveRequest struct to remove compute instance diff --git a/pkg/cloudbroker/flipgroup/create.go b/pkg/cloudbroker/flipgroup/create.go index a7fb2c1..b287f9d 100644 --- a/pkg/cloudbroker/flipgroup/create.go +++ b/pkg/cloudbroker/flipgroup/create.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create FLIPGroup diff --git a/pkg/cloudbroker/flipgroup/delete.go b/pkg/cloudbroker/flipgroup/delete.go index 3c4a3a1..901dfb8 100644 --- a/pkg/cloudbroker/flipgroup/delete.go +++ b/pkg/cloudbroker/flipgroup/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete FLIPGroup diff --git a/pkg/cloudbroker/flipgroup/edit.go b/pkg/cloudbroker/flipgroup/edit.go index 777a24e..5d67abd 100644 --- a/pkg/cloudbroker/flipgroup/edit.go +++ b/pkg/cloudbroker/flipgroup/edit.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EditRequest struct to edit FLIPGroup diff --git a/pkg/cloudbroker/flipgroup/flipgroup.go b/pkg/cloudbroker/flipgroup/flipgroup.go index 038055e..3836927 100644 --- a/pkg/cloudbroker/flipgroup/flipgroup.go +++ b/pkg/cloudbroker/flipgroup/flipgroup.go @@ -2,7 +2,7 @@ package flipgroup import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to FLIPGroup diff --git a/pkg/cloudbroker/flipgroup/get.go b/pkg/cloudbroker/flipgroup/get.go index 7e1d137..57e5c95 100644 --- a/pkg/cloudbroker/flipgroup/get.go +++ b/pkg/cloudbroker/flipgroup/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about FLIPGroup diff --git a/pkg/cloudbroker/flipgroup/list.go b/pkg/cloudbroker/flipgroup/list.go index 8c2e308..78046bd 100644 --- a/pkg/cloudbroker/flipgroup/list.go +++ b/pkg/cloudbroker/flipgroup/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of FLIPGroup available to the current user diff --git a/pkg/cloudbroker/flipgroup/serialize.go b/pkg/cloudbroker/flipgroup/serialize.go index 9f367e3..a53fca9 100644 --- a/pkg/cloudbroker/flipgroup/serialize.go +++ b/pkg/cloudbroker/flipgroup/serialize.go @@ -3,7 +3,7 @@ package flipgroup import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/grid.go b/pkg/cloudbroker/grid.go index cb5ed97..06ea277 100644 --- a/pkg/cloudbroker/grid.go +++ b/pkg/cloudbroker/grid.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/grid" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/grid" // Accessing the Grid method group func (cb *CloudBroker) Grid() *grid.Grid { diff --git a/pkg/cloudbroker/grid/add.go b/pkg/cloudbroker/grid/add.go index a750456..fa0b375 100644 --- a/pkg/cloudbroker/grid/add.go +++ b/pkg/cloudbroker/grid/add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddRequest struct for location code diff --git a/pkg/cloudbroker/grid/add_custom_backup_path.go b/pkg/cloudbroker/grid/add_custom_backup_path.go index f822296..3ed980a 100644 --- a/pkg/cloudbroker/grid/add_custom_backup_path.go +++ b/pkg/cloudbroker/grid/add_custom_backup_path.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddCustomBackupPathRequest struct to add new path to the list of custom backup paths diff --git a/pkg/cloudbroker/grid/change_settings.go b/pkg/cloudbroker/grid/change_settings.go index 2ba0257..f4a44ce 100644 --- a/pkg/cloudbroker/grid/change_settings.go +++ b/pkg/cloudbroker/grid/change_settings.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ChangeSettingsRequest struct to change grid settings diff --git a/pkg/cloudbroker/grid/execute_maintenance_script.go b/pkg/cloudbroker/grid/execute_maintenance_script.go index 1d9aa99..8c86fc8 100644 --- a/pkg/cloudbroker/grid/execute_maintenance_script.go +++ b/pkg/cloudbroker/grid/execute_maintenance_script.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ExecuteMaintenanceScriptRequest struct to execute script diff --git a/pkg/cloudbroker/grid/get.go b/pkg/cloudbroker/grid/get.go index 8acd78f..0c55ecf 100644 --- a/pkg/cloudbroker/grid/get.go +++ b/pkg/cloudbroker/grid/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get grid details diff --git a/pkg/cloudbroker/grid/get_backup.go b/pkg/cloudbroker/grid/get_backup.go index 12d5c9a..99526c3 100644 --- a/pkg/cloudbroker/grid/get_backup.go +++ b/pkg/cloudbroker/grid/get_backup.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetBackupRequest struct to get backup diff --git a/pkg/cloudbroker/grid/get_diagnosis.go b/pkg/cloudbroker/grid/get_diagnosis.go index 72be731..1ebd350 100644 --- a/pkg/cloudbroker/grid/get_diagnosis.go +++ b/pkg/cloudbroker/grid/get_diagnosis.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetDiagnosisRequest struct to get platform snapshot with additional diagnosis diff --git a/pkg/cloudbroker/grid/get_resource_consumption.go b/pkg/cloudbroker/grid/get_resource_consumption.go index ef6a0e2..7b81e9b 100644 --- a/pkg/cloudbroker/grid/get_resource_consumption.go +++ b/pkg/cloudbroker/grid/get_resource_consumption.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetResourceConsumptionRequest struct to get resource consumption diff --git a/pkg/cloudbroker/grid/get_settings.go b/pkg/cloudbroker/grid/get_settings.go index df66d48..f08ba1b 100644 --- a/pkg/cloudbroker/grid/get_settings.go +++ b/pkg/cloudbroker/grid/get_settings.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetSettingsRequest struct to get grid settings diff --git a/pkg/cloudbroker/grid/grid.go b/pkg/cloudbroker/grid/grid.go index 3a5f49a..fb1e5ac 100644 --- a/pkg/cloudbroker/grid/grid.go +++ b/pkg/cloudbroker/grid/grid.go @@ -2,7 +2,7 @@ package grid import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to grid diff --git a/pkg/cloudbroker/grid/list.go b/pkg/cloudbroker/grid/list.go index 1f97989..7f29f95 100644 --- a/pkg/cloudbroker/grid/list.go +++ b/pkg/cloudbroker/grid/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of locations diff --git a/pkg/cloudbroker/grid/purge_logs.go b/pkg/cloudbroker/grid/purge_logs.go index 5555cca..b25c921 100644 --- a/pkg/cloudbroker/grid/purge_logs.go +++ b/pkg/cloudbroker/grid/purge_logs.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // PurgeLogsRequest struct to purge logs diff --git a/pkg/cloudbroker/grid/remove_custom_backup_path.go b/pkg/cloudbroker/grid/remove_custom_backup_path.go index b4a6940..fd0f757 100644 --- a/pkg/cloudbroker/grid/remove_custom_backup_path.go +++ b/pkg/cloudbroker/grid/remove_custom_backup_path.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RemoveCustomBackupPathRequest struct to remove path from the list of custom backup paths diff --git a/pkg/cloudbroker/grid/rename.go b/pkg/cloudbroker/grid/rename.go index 2c8592e..7579b5f 100644 --- a/pkg/cloudbroker/grid/rename.go +++ b/pkg/cloudbroker/grid/rename.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RenameRequest struct to rename grid diff --git a/pkg/cloudbroker/grid/serialize.go b/pkg/cloudbroker/grid/serialize.go index 1380617..e9bf05e 100644 --- a/pkg/cloudbroker/grid/serialize.go +++ b/pkg/cloudbroker/grid/serialize.go @@ -3,7 +3,7 @@ package grid import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/grid/services_restart.go b/pkg/cloudbroker/grid/services_restart.go index 01deab1..5ab86f3 100644 --- a/pkg/cloudbroker/grid/services_restart.go +++ b/pkg/cloudbroker/grid/services_restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ServicesRestartRequest struct to restart services diff --git a/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go b/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go index 4ea5039..243b2f3 100644 --- a/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go +++ b/pkg/cloudbroker/grid/set_cpu_allocation_parameter.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCPUAllocationParameterRequest for setting CPU allocation parameter diff --git a/pkg/cloudbroker/grid/set_cpu_allocation_ratio.go b/pkg/cloudbroker/grid/set_cpu_allocation_ratio.go index 0709327..33ec70c 100644 --- a/pkg/cloudbroker/grid/set_cpu_allocation_ratio.go +++ b/pkg/cloudbroker/grid/set_cpu_allocation_ratio.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCPUAllocationRatioRequest struct to set allocation diff --git a/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go b/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go index 0916313..6b698d8 100644 --- a/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go +++ b/pkg/cloudbroker/grid/set_cpu_allocation_ratio_for_vm.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCPUAllocationRatioForVMRequest for setting CPU allocation ratio for computes diff --git a/pkg/cloudbroker/grid/set_mem_allocation_ratio.go b/pkg/cloudbroker/grid/set_mem_allocation_ratio.go index dc628e4..9b7fcca 100644 --- a/pkg/cloudbroker/grid/set_mem_allocation_ratio.go +++ b/pkg/cloudbroker/grid/set_mem_allocation_ratio.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetMemAllocationRatioRequest struct to set memory allocation diff --git a/pkg/cloudbroker/grid/set_password_policy.go b/pkg/cloudbroker/grid/set_password_policy.go index a0733d1..a7ae125 100644 --- a/pkg/cloudbroker/grid/set_password_policy.go +++ b/pkg/cloudbroker/grid/set_password_policy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetPasswordPolicyRequest struct to set password policy for a grid diff --git a/pkg/cloudbroker/group.go b/pkg/cloudbroker/group.go index 932ad19..8585b7e 100644 --- a/pkg/cloudbroker/group.go +++ b/pkg/cloudbroker/group.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/group" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/group" // Accessing the Group method group func (cb *CloudBroker) Group() *group.Group { diff --git a/pkg/cloudbroker/group/get.go b/pkg/cloudbroker/group/get.go index de518d4..8acd081 100644 --- a/pkg/cloudbroker/group/get.go +++ b/pkg/cloudbroker/group/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get details of the specified group. diff --git a/pkg/cloudbroker/group/group.go b/pkg/cloudbroker/group/group.go index 824bcc4..5069ef4 100644 --- a/pkg/cloudbroker/group/group.go +++ b/pkg/cloudbroker/group/group.go @@ -1,6 +1,6 @@ package group -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to group type Group struct { diff --git a/pkg/cloudbroker/group/list.go b/pkg/cloudbroker/group/list.go index b6552a6..be6cf2d 100644 --- a/pkg/cloudbroker/group/list.go +++ b/pkg/cloudbroker/group/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of group instances. diff --git a/pkg/cloudbroker/image.go b/pkg/cloudbroker/image.go index c2688f2..f12fff2 100644 --- a/pkg/cloudbroker/image.go +++ b/pkg/cloudbroker/image.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/image" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/image" ) // Accessing the Image method group diff --git a/pkg/cloudbroker/image/computeci_set.go b/pkg/cloudbroker/image/computeci_set.go index 8539d89..944b365 100644 --- a/pkg/cloudbroker/image/computeci_set.go +++ b/pkg/cloudbroker/image/computeci_set.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeCISetRequest struct to set compute CI diff --git a/pkg/cloudbroker/image/computeci_unset.go b/pkg/cloudbroker/image/computeci_unset.go index 490c789..62ef781 100644 --- a/pkg/cloudbroker/image/computeci_unset.go +++ b/pkg/cloudbroker/image/computeci_unset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ComputeCIUnsetRequest struct to unset compute CI diff --git a/pkg/cloudbroker/image/create_cdrom_image.go b/pkg/cloudbroker/image/create_cdrom_image.go index ea5d18e..ae230d2 100644 --- a/pkg/cloudbroker/image/create_cdrom_image.go +++ b/pkg/cloudbroker/image/create_cdrom_image.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateCDROMImageRequest struct to create CD-ROM image @@ -18,10 +18,6 @@ type CreateCDROMImageRequest struct { // Required: true URL string `url:"url" json:"url" validate:"required,url"` - // Grid (platform) ID where this CD-ROM image should be create in - // Required: true - GID uint64 `url:"gid" json:"gid" validate:"required"` - // Account ID to make the image exclusive // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` diff --git a/pkg/cloudbroker/image/create_image.go b/pkg/cloudbroker/image/create_image.go index c0de08f..afe0f28 100644 --- a/pkg/cloudbroker/image/create_image.go +++ b/pkg/cloudbroker/image/create_image.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create image @@ -18,10 +18,6 @@ type CreateRequest struct { // Required: true URL string `url:"url" json:"url" validate:"required,url"` - // Grid (platform) ID where this template should be create in - // Required: true - GID uint64 `url:"gid" json:"gid" validate:"required"` - // Boot type of image // Should be one of: // - bios diff --git a/pkg/cloudbroker/image/create_virtual.go b/pkg/cloudbroker/image/create_virtual.go index bfef14b..da8d11b 100644 --- a/pkg/cloudbroker/image/create_virtual.go +++ b/pkg/cloudbroker/image/create_virtual.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateVirtualRequest struct to create virtual image diff --git a/pkg/cloudbroker/image/delete.go b/pkg/cloudbroker/image/delete.go index bc361ef..a69bd2b 100644 --- a/pkg/cloudbroker/image/delete.go +++ b/pkg/cloudbroker/image/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete image diff --git a/pkg/cloudbroker/image/delete_cdrom_image.go b/pkg/cloudbroker/image/delete_cdrom_image.go index 18c01ca..9ea2254 100644 --- a/pkg/cloudbroker/image/delete_cdrom_image.go +++ b/pkg/cloudbroker/image/delete_cdrom_image.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteCDROMImageRequest struct to delete CD-ROM image diff --git a/pkg/cloudbroker/image/delete_images.go b/pkg/cloudbroker/image/delete_images.go index 481b004..9f9a723 100644 --- a/pkg/cloudbroker/image/delete_images.go +++ b/pkg/cloudbroker/image/delete_images.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteImagesRequest struct to delete images diff --git a/pkg/cloudbroker/image/disable.go b/pkg/cloudbroker/image/disable.go index bd206ee..8fd7859 100644 --- a/pkg/cloudbroker/image/disable.go +++ b/pkg/cloudbroker/image/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable image diff --git a/pkg/cloudbroker/image/edit.go b/pkg/cloudbroker/image/edit.go index dbf531b..6106802 100644 --- a/pkg/cloudbroker/image/edit.go +++ b/pkg/cloudbroker/image/edit.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EditRequest struct to edit image diff --git a/pkg/cloudbroker/image/enable.go b/pkg/cloudbroker/image/enable.go index c5104a3..aa86fd1 100644 --- a/pkg/cloudbroker/image/enable.go +++ b/pkg/cloudbroker/image/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable image diff --git a/pkg/cloudbroker/image/filter_test.go b/pkg/cloudbroker/image/filter_test.go index 079bdcb..d02bcbc 100644 --- a/pkg/cloudbroker/image/filter_test.go +++ b/pkg/cloudbroker/image/filter_test.go @@ -29,7 +29,7 @@ var images = ListImages{ Name: "u16", Password: "", Pool: "vmstor", - PresentTo: []uint64{}, + PresentTo: map[string]uint64{}, ProviderName: "", PurgeAttempts: 0, ReferenceID: "sample_reference_id_u16", @@ -72,7 +72,7 @@ var images = ListImages{ Name: "alpine-virt-3.17", Password: "", Pool: "vmstor", - PresentTo: []uint64{}, + PresentTo: map[string]uint64{}, ProviderName: "", PurgeAttempts: 0, ReferenceID: "sample_reference_id_alpine", @@ -115,7 +115,7 @@ var images = ListImages{ Name: "test", Password: "", Pool: "vmstor", - PresentTo: []uint64{}, + PresentTo: map[string]uint64{}, ProviderName: "", PurgeAttempts: 0, ReferenceID: "sample_reference_id_test", diff --git a/pkg/cloudbroker/image/get.go b/pkg/cloudbroker/image/get.go index f8031bf..95ee7c0 100644 --- a/pkg/cloudbroker/image/get.go +++ b/pkg/cloudbroker/image/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get image details diff --git a/pkg/cloudbroker/image/grant_access.go b/pkg/cloudbroker/image/grant_access.go index 9e94d6f..ddca871 100644 --- a/pkg/cloudbroker/image/grant_access.go +++ b/pkg/cloudbroker/image/grant_access.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GrantAccessRequest struct to share image with accounts @@ -16,7 +16,7 @@ type GrantAccessRequest struct { // ID of the accounts for share image // Required: true - AccountIDs []uint64 `url:"accounts" json:"accounts" validate:"required"` + AccountIDs []int64 `url:"accounts" json:"accounts" validate:"required"` } // GrantAccess shares specified image with specified accounts diff --git a/pkg/cloudbroker/image/image.go b/pkg/cloudbroker/image/image.go index 303d448..2795463 100644 --- a/pkg/cloudbroker/image/image.go +++ b/pkg/cloudbroker/image/image.go @@ -1,7 +1,7 @@ // Lists all the images. A image is a template which can be used to deploy machines package image -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to image type Image struct { diff --git a/pkg/cloudbroker/image/link.go b/pkg/cloudbroker/image/link.go index 9763199..471c117 100644 --- a/pkg/cloudbroker/image/link.go +++ b/pkg/cloudbroker/image/link.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // LinkRequest struct to link virtual image to another image diff --git a/pkg/cloudbroker/image/list.go b/pkg/cloudbroker/image/list.go index bf7e530..f38f14b 100644 --- a/pkg/cloudbroker/image/list.go +++ b/pkg/cloudbroker/image/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of available images diff --git a/pkg/cloudbroker/image/list_stacks.go b/pkg/cloudbroker/image/list_stacks.go index 1b028e4..c51e40c 100644 --- a/pkg/cloudbroker/image/list_stacks.go +++ b/pkg/cloudbroker/image/list_stacks.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListStacksRequest struct to get list of stack diff --git a/pkg/cloudbroker/image/models.go b/pkg/cloudbroker/image/models.go index 22e0a39..6ace868 100644 --- a/pkg/cloudbroker/image/models.go +++ b/pkg/cloudbroker/image/models.go @@ -75,7 +75,7 @@ type RecordImage struct { Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Provider name ProviderName string `json:"provider_name"` @@ -201,7 +201,7 @@ type ItemImage struct { Pool string `json:"pool"` // Present to - PresentTo []uint64 `json:"presentTo"` + PresentTo map[string]uint64 `json:"presentTo"` // Provider name ProviderName string `json:"provider_name"` diff --git a/pkg/cloudbroker/image/rename.go b/pkg/cloudbroker/image/rename.go index eefcf44..de50a5e 100644 --- a/pkg/cloudbroker/image/rename.go +++ b/pkg/cloudbroker/image/rename.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RenameRequest struct to rename image diff --git a/pkg/cloudbroker/image/revoke_access.go b/pkg/cloudbroker/image/revoke_access.go index 071af97..3b8df29 100644 --- a/pkg/cloudbroker/image/revoke_access.go +++ b/pkg/cloudbroker/image/revoke_access.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RevokeAccessRequest struct to unshare image with accounts @@ -16,7 +16,7 @@ type RevokeAccessRequest struct { // ID of the accounts for unshare image // Required: true - AccountIDs []uint64 `url:"accounts" json:"accounts" validate:"required"` + AccountIDs []int64 `url:"accounts" json:"accounts" validate:"required"` } // RevokeAccess unshares specified image with specified accounts diff --git a/pkg/cloudbroker/image/serialize.go b/pkg/cloudbroker/image/serialize.go index 5233a3c..f1b482a 100644 --- a/pkg/cloudbroker/image/serialize.go +++ b/pkg/cloudbroker/image/serialize.go @@ -3,7 +3,7 @@ package image import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/image/share.go b/pkg/cloudbroker/image/share.go index 1791023..208d3a3 100644 --- a/pkg/cloudbroker/image/share.go +++ b/pkg/cloudbroker/image/share.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ShareRequest struct to share image diff --git a/pkg/cloudbroker/image/sync_create_image.go b/pkg/cloudbroker/image/sync_create_image.go index fc504ab..c2939fd 100644 --- a/pkg/cloudbroker/image/sync_create_image.go +++ b/pkg/cloudbroker/image/sync_create_image.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SyncCreateRequest struct to sync create image diff --git a/pkg/cloudbroker/image/update_nodes.go b/pkg/cloudbroker/image/update_nodes.go index 7d742f1..c89b157 100644 --- a/pkg/cloudbroker/image/update_nodes.go +++ b/pkg/cloudbroker/image/update_nodes.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateNodesRequest struct to update nodes diff --git a/pkg/cloudbroker/image/upload_image_file.go b/pkg/cloudbroker/image/upload_image_file.go deleted file mode 100644 index 1268eae..0000000 --- a/pkg/cloudbroker/image/upload_image_file.go +++ /dev/null @@ -1,39 +0,0 @@ -package image - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "os" -) - -// UploadImageFileResponse struct to enable image -type UploadImageFileResponse struct { - // ImageFileUri - ImageFileUri string `json:"image_file_uri"` -} - -// UploadImageFile uploads file image to platform -func (i Image) UploadImageFile(ctx context.Context, filePath string) (string, error) { - file, err := os.ReadFile(filePath) - if err != nil { - return "", fmt.Errorf("can not read file %v", err) - } - - url := "/cloudbroker/image/uploadImageFile" - - res, err := i.client.DecortApiCall(ctx, http.MethodPost, url, file) - if err != nil { - return "", err - } - - result := UploadImageFileResponse{} - - err = json.Unmarshal(res, &result) - if err != nil { - return "", err - } - - return result.ImageFileUri, nil -} diff --git a/pkg/cloudbroker/k8ci.go b/pkg/cloudbroker/k8ci.go index 74fcf5d..14f09ad 100644 --- a/pkg/cloudbroker/k8ci.go +++ b/pkg/cloudbroker/k8ci.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/k8ci" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/k8ci" ) // Accessing the K8CI method group diff --git a/pkg/cloudbroker/k8ci/access_add.go b/pkg/cloudbroker/k8ci/access_add.go index e54a3cd..0773813 100644 --- a/pkg/cloudbroker/k8ci/access_add.go +++ b/pkg/cloudbroker/k8ci/access_add.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessAddRequest struct for adding permission to access to account for a k8ci diff --git a/pkg/cloudbroker/k8ci/access_remove.go b/pkg/cloudbroker/k8ci/access_remove.go index a1c8a74..c2efa2d 100644 --- a/pkg/cloudbroker/k8ci/access_remove.go +++ b/pkg/cloudbroker/k8ci/access_remove.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessRemoveRequest struct for removing permission to access to account for a k8ci diff --git a/pkg/cloudbroker/k8ci/create.go b/pkg/cloudbroker/k8ci/create.go index e85b258..8d7663a 100644 --- a/pkg/cloudbroker/k8ci/create.go +++ b/pkg/cloudbroker/k8ci/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create K8CI instance diff --git a/pkg/cloudbroker/k8ci/delete.go b/pkg/cloudbroker/k8ci/delete.go index bccb9ae..62b6927 100644 --- a/pkg/cloudbroker/k8ci/delete.go +++ b/pkg/cloudbroker/k8ci/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete K8CI diff --git a/pkg/cloudbroker/k8ci/disable.go b/pkg/cloudbroker/k8ci/disable.go index 64f5df5..f0724bf 100644 --- a/pkg/cloudbroker/k8ci/disable.go +++ b/pkg/cloudbroker/k8ci/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable K8CI diff --git a/pkg/cloudbroker/k8ci/enable.go b/pkg/cloudbroker/k8ci/enable.go index a56d19c..149f76c 100644 --- a/pkg/cloudbroker/k8ci/enable.go +++ b/pkg/cloudbroker/k8ci/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable K8CI diff --git a/pkg/cloudbroker/k8ci/get.go b/pkg/cloudbroker/k8ci/get.go index 7c82fbf..dacbe00 100644 --- a/pkg/cloudbroker/k8ci/get.go +++ b/pkg/cloudbroker/k8ci/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about K8CI diff --git a/pkg/cloudbroker/k8ci/k8ci.go b/pkg/cloudbroker/k8ci/k8ci.go index de848cc..f181192 100644 --- a/pkg/cloudbroker/k8ci/k8ci.go +++ b/pkg/cloudbroker/k8ci/k8ci.go @@ -2,7 +2,7 @@ package k8ci import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to K8CI diff --git a/pkg/cloudbroker/k8ci/list.go b/pkg/cloudbroker/k8ci/list.go index 44c529f..99f9177 100644 --- a/pkg/cloudbroker/k8ci/list.go +++ b/pkg/cloudbroker/k8ci/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list information about images diff --git a/pkg/cloudbroker/k8ci/list_deleted.go b/pkg/cloudbroker/k8ci/list_deleted.go index 48df43f..6ca5e1f 100644 --- a/pkg/cloudbroker/k8ci/list_deleted.go +++ b/pkg/cloudbroker/k8ci/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list information about deleted k8ci items diff --git a/pkg/cloudbroker/k8ci/restore.go b/pkg/cloudbroker/k8ci/restore.go index c7f82e9..64b82d6 100644 --- a/pkg/cloudbroker/k8ci/restore.go +++ b/pkg/cloudbroker/k8ci/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore K8CI diff --git a/pkg/cloudbroker/k8ci/serialize.go b/pkg/cloudbroker/k8ci/serialize.go index e63136d..f5d61be 100644 --- a/pkg/cloudbroker/k8ci/serialize.go +++ b/pkg/cloudbroker/k8ci/serialize.go @@ -3,7 +3,7 @@ package k8ci import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/k8s.go b/pkg/cloudbroker/k8s.go index d13b5e4..251f2e5 100644 --- a/pkg/cloudbroker/k8s.go +++ b/pkg/cloudbroker/k8s.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/k8s" ) // Accessing the K8S method group diff --git a/pkg/cloudbroker/k8s/create.go b/pkg/cloudbroker/k8s/create.go index 0e61c2a..e291f19 100644 --- a/pkg/cloudbroker/k8s/create.go +++ b/pkg/cloudbroker/k8s/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create K8S diff --git a/pkg/cloudbroker/k8s/delete.go b/pkg/cloudbroker/k8s/delete.go index c8b328f..38a4a77 100644 --- a/pkg/cloudbroker/k8s/delete.go +++ b/pkg/cloudbroker/k8s/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete kubernetes cluster diff --git a/pkg/cloudbroker/k8s/delete_master_from_group.go b/pkg/cloudbroker/k8s/delete_master_from_group.go index e1cfc6f..655c99a 100644 --- a/pkg/cloudbroker/k8s/delete_master_from_group.go +++ b/pkg/cloudbroker/k8s/delete_master_from_group.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteMasterFromGroupRequest struct to delete master from group diff --git a/pkg/cloudbroker/k8s/delete_worker_from_group.go b/pkg/cloudbroker/k8s/delete_worker_from_group.go index 9f5544b..a07c059 100644 --- a/pkg/cloudbroker/k8s/delete_worker_from_group.go +++ b/pkg/cloudbroker/k8s/delete_worker_from_group.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteWorkerFromGroupRequest struct to delete worker from group diff --git a/pkg/cloudbroker/k8s/disable.go b/pkg/cloudbroker/k8s/disable.go index 170645d..2eb9e88 100644 --- a/pkg/cloudbroker/k8s/disable.go +++ b/pkg/cloudbroker/k8s/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable kubernetes cluster diff --git a/pkg/cloudbroker/k8s/enable.go b/pkg/cloudbroker/k8s/enable.go index b26fdc0..baef340 100644 --- a/pkg/cloudbroker/k8s/enable.go +++ b/pkg/cloudbroker/k8s/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable kubernetes cluster diff --git a/pkg/cloudbroker/k8s/find_group_by_label.go b/pkg/cloudbroker/k8s/find_group_by_label.go index ae03607..0e974f3 100644 --- a/pkg/cloudbroker/k8s/find_group_by_label.go +++ b/pkg/cloudbroker/k8s/find_group_by_label.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FindGroupByLabelRequest struct for get information about group of kubernetes cluster diff --git a/pkg/cloudbroker/k8s/get.go b/pkg/cloudbroker/k8s/get.go index d8c5356..a66a0a6 100644 --- a/pkg/cloudbroker/k8s/get.go +++ b/pkg/cloudbroker/k8s/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about kubernetes cluster diff --git a/pkg/cloudbroker/k8s/get_config.go b/pkg/cloudbroker/k8s/get_config.go index d6a9b50..e1087a7 100644 --- a/pkg/cloudbroker/k8s/get_config.go +++ b/pkg/cloudbroker/k8s/get_config.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetConfigRequest struct to get configuration of kubernetes cluster diff --git a/pkg/cloudbroker/k8s/get_node_annotations.go b/pkg/cloudbroker/k8s/get_node_annotations.go index bfd4c86..2cd018b 100644 --- a/pkg/cloudbroker/k8s/get_node_annotations.go +++ b/pkg/cloudbroker/k8s/get_node_annotations.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetNodeAnnotationsRequest struct to get node annotations diff --git a/pkg/cloudbroker/k8s/get_node_labels.go b/pkg/cloudbroker/k8s/get_node_labels.go index e4ed8f7..033bc18 100644 --- a/pkg/cloudbroker/k8s/get_node_labels.go +++ b/pkg/cloudbroker/k8s/get_node_labels.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetNodeLabelsRequest struct to get worker node labels diff --git a/pkg/cloudbroker/k8s/get_node_taints.go b/pkg/cloudbroker/k8s/get_node_taints.go index 6676b22..9cec4bc 100644 --- a/pkg/cloudbroker/k8s/get_node_taints.go +++ b/pkg/cloudbroker/k8s/get_node_taints.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetNodeTaintsRequest struct to get node taints diff --git a/pkg/cloudbroker/k8s/get_worker_nodes_meta_data.go b/pkg/cloudbroker/k8s/get_worker_nodes_meta_data.go index ac12336..e7d955e 100644 --- a/pkg/cloudbroker/k8s/get_worker_nodes_meta_data.go +++ b/pkg/cloudbroker/k8s/get_worker_nodes_meta_data.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetWorkerNodesMetaDataRequest struct to get worker group metadata by ID diff --git a/pkg/cloudbroker/k8s/k8s.go b/pkg/cloudbroker/k8s/k8s.go index 15735af..ed55b4c 100644 --- a/pkg/cloudbroker/k8s/k8s.go +++ b/pkg/cloudbroker/k8s/k8s.go @@ -2,7 +2,7 @@ package k8s import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to K8S diff --git a/pkg/cloudbroker/k8s/list.go b/pkg/cloudbroker/k8s/list.go index 6ff913b..cf782f1 100644 --- a/pkg/cloudbroker/k8s/list.go +++ b/pkg/cloudbroker/k8s/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list information K8S diff --git a/pkg/cloudbroker/k8s/list_deleted.go b/pkg/cloudbroker/k8s/list_deleted.go index b8367fb..ac9651a 100644 --- a/pkg/cloudbroker/k8s/list_deleted.go +++ b/pkg/cloudbroker/k8s/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted kubernetes cluster diff --git a/pkg/cloudbroker/k8s/models.go b/pkg/cloudbroker/k8s/models.go index ed063bb..ec180c1 100644 --- a/pkg/cloudbroker/k8s/models.go +++ b/pkg/cloudbroker/k8s/models.go @@ -89,6 +89,9 @@ type RecordK8S struct { // Deleted time DeletedTime uint64 `json:"deletedTime"` + // Description + Description string `json:"desc"` + // Only external network ExtnetOnly bool `json:"extnetOnly"` diff --git a/pkg/cloudbroker/k8s/restore.go b/pkg/cloudbroker/k8s/restore.go index 53b6aec..c9daf1b 100644 --- a/pkg/cloudbroker/k8s/restore.go +++ b/pkg/cloudbroker/k8s/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore kubernetes cluster diff --git a/pkg/cloudbroker/k8s/serialize.go b/pkg/cloudbroker/k8s/serialize.go index 39a0060..3aa4334 100644 --- a/pkg/cloudbroker/k8s/serialize.go +++ b/pkg/cloudbroker/k8s/serialize.go @@ -3,7 +3,7 @@ package k8s import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/k8s/start.go b/pkg/cloudbroker/k8s/start.go index 5367257..eb80d45 100644 --- a/pkg/cloudbroker/k8s/start.go +++ b/pkg/cloudbroker/k8s/start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StartRequest struct to start kubernetes cluster diff --git a/pkg/cloudbroker/k8s/stop.go b/pkg/cloudbroker/k8s/stop.go index 83f7a1b..ceddf49 100644 --- a/pkg/cloudbroker/k8s/stop.go +++ b/pkg/cloudbroker/k8s/stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StopRequest struct to stop kubernetes cluster diff --git a/pkg/cloudbroker/k8s/update.go b/pkg/cloudbroker/k8s/update.go index 58d3e67..baa05a1 100644 --- a/pkg/cloudbroker/k8s/update.go +++ b/pkg/cloudbroker/k8s/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update kubernetes cluster diff --git a/pkg/cloudbroker/k8s/update_worker_nodes_meta_data.go b/pkg/cloudbroker/k8s/update_worker_nodes_meta_data.go index 2ac2f0e..0df5451 100644 --- a/pkg/cloudbroker/k8s/update_worker_nodes_meta_data.go +++ b/pkg/cloudbroker/k8s/update_worker_nodes_meta_data.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateWorkerNodesMetaDataRequest struct to add worker to a kubernetes cluster diff --git a/pkg/cloudbroker/k8s/worker_add.go b/pkg/cloudbroker/k8s/worker_add.go index 1934d36..8ab7d41 100644 --- a/pkg/cloudbroker/k8s/worker_add.go +++ b/pkg/cloudbroker/k8s/worker_add.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkerAddRequest struct to add worker to a kubernetes cluster diff --git a/pkg/cloudbroker/k8s/worker_reset.go b/pkg/cloudbroker/k8s/worker_reset.go index 8d9feaa..e6efe64 100644 --- a/pkg/cloudbroker/k8s/worker_reset.go +++ b/pkg/cloudbroker/k8s/worker_reset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkerResetRequest struct for hard reset kubernetes cluster diff --git a/pkg/cloudbroker/k8s/worker_restart.go b/pkg/cloudbroker/k8s/worker_restart.go index f6c8d75..4e1a52e 100644 --- a/pkg/cloudbroker/k8s/worker_restart.go +++ b/pkg/cloudbroker/k8s/worker_restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkerRestartRequest struct to restart worker node diff --git a/pkg/cloudbroker/k8s/workers_group_add.go b/pkg/cloudbroker/k8s/workers_group_add.go index c8f6d6e..4103071 100644 --- a/pkg/cloudbroker/k8s/workers_group_add.go +++ b/pkg/cloudbroker/k8s/workers_group_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkersGroupAddRequest struct to add workers group diff --git a/pkg/cloudbroker/k8s/workers_group_delete.go b/pkg/cloudbroker/k8s/workers_group_delete.go index 6600299..84750b9 100644 --- a/pkg/cloudbroker/k8s/workers_group_delete.go +++ b/pkg/cloudbroker/k8s/workers_group_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkersGroupDeleteRequest struct to delete workers group diff --git a/pkg/cloudbroker/k8s/workers_group_get_by_name.go b/pkg/cloudbroker/k8s/workers_group_get_by_name.go index b8312dc..6e94b0b 100644 --- a/pkg/cloudbroker/k8s/workers_group_get_by_name.go +++ b/pkg/cloudbroker/k8s/workers_group_get_by_name.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // WorkersGroupGetByNameRequest struct to get information about worker group diff --git a/pkg/cloudbroker/kvmx86.go b/pkg/cloudbroker/kvmx86.go index 070e466..a98583a 100644 --- a/pkg/cloudbroker/kvmx86.go +++ b/pkg/cloudbroker/kvmx86.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/kvmx86" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/kvmx86" ) // Accessing the KVMX86 method group diff --git a/pkg/cloudbroker/kvmx86/create.go b/pkg/cloudbroker/kvmx86/create.go index ff308ba..bd20689 100644 --- a/pkg/cloudbroker/kvmx86/create.go +++ b/pkg/cloudbroker/kvmx86/create.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type Interface struct { @@ -31,6 +31,10 @@ type Interface struct { // Used only to DPDK net type // Required: false MTU uint64 `url:"mtu,omitempty" json:"mtu,omitempty" validate:"omitempty,mtu"` + + // MAC address to assign to this VM when connecting to the specified network + // Required: false + MAC string `url:"mac,omitempty" json:"mac,omitempty" validate:"omitempty"` } // DataDisk detailed struct for DataDisks field in CreateRequest, CreateBlankRequest and MassCreateRequest diff --git a/pkg/cloudbroker/kvmx86/create_blank.go b/pkg/cloudbroker/kvmx86/create_blank.go index 5e146bc..a487c98 100644 --- a/pkg/cloudbroker/kvmx86/create_blank.go +++ b/pkg/cloudbroker/kvmx86/create_blank.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateBlankRequest struct to create KVM x86 VM from scratch @@ -72,6 +72,22 @@ type CreateBlankRequest struct { // Recommended isolated CPUs. Field is ignored if compute.cpupin=False or compute.pinned=False // Required: false PreferredCPU []int64 `url:"preferredCpu,omitempty" json:"preferredCpu,omitempty" validate:"omitempty,preferredCPU"` + + // VM type linux, windows or unknown + // Required: false + LoaderType string `url:"loaderType,omitempty" json:"loaderType,omitempty" validate:"omitempty,loaderType"` + + // Boot type of image bios or uefi + // Required: false + BootType string `url:"bootType,omitempty" json:"bootType,omitempty" validate:"omitempty,imageBootType"` + + // Select a network interface naming pattern for your Linux machine. eth - onboard, ens - pci slot naming. + // Required: false + NetworkInterfaceNaming string `url:"networkInterfaceNaming,omitempty" json:"networkInterfaceNaming,omitempty" validate:"omitempty,networkInterfaceNaming"` + + // Does this machine supports hot resize + // Required: false + HotResize bool `url:"hotResize,omitempty" json:"hotResize,omitempty"` } // GetRAM returns RAM field values diff --git a/pkg/cloudbroker/kvmx86/kvmx86.go b/pkg/cloudbroker/kvmx86/kvmx86.go index d0051f0..05011a0 100644 --- a/pkg/cloudbroker/kvmx86/kvmx86.go +++ b/pkg/cloudbroker/kvmx86/kvmx86.go @@ -1,7 +1,7 @@ // API to manage KVM x86 compute instances (x86 VMs) package kvmx86 -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to KVMX86 type KVMX86 struct { diff --git a/pkg/cloudbroker/kvmx86/mass_create.go b/pkg/cloudbroker/kvmx86/mass_create.go index d186cf1..f6bf3a9 100644 --- a/pkg/cloudbroker/kvmx86/mass_create.go +++ b/pkg/cloudbroker/kvmx86/mass_create.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassCreateRequest struct to mass create KVM x86 diff --git a/pkg/cloudbroker/lb.go b/pkg/cloudbroker/lb.go index c9db48f..e1b5e0d 100644 --- a/pkg/cloudbroker/lb.go +++ b/pkg/cloudbroker/lb.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/lb" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/lb" // Accessing the LB method group func (cb *CloudBroker) LB() *lb.LB { diff --git a/pkg/cloudbroker/lb/backend_create.go b/pkg/cloudbroker/lb/backend_create.go index 60988d3..6c1ba70 100644 --- a/pkg/cloudbroker/lb/backend_create.go +++ b/pkg/cloudbroker/lb/backend_create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendCreateRequest struct to create backend diff --git a/pkg/cloudbroker/lb/backend_delete.go b/pkg/cloudbroker/lb/backend_delete.go index fe0df6a..02d2a95 100644 --- a/pkg/cloudbroker/lb/backend_delete.go +++ b/pkg/cloudbroker/lb/backend_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendDeleteRequest struct to delete backend diff --git a/pkg/cloudbroker/lb/backend_server_add.go b/pkg/cloudbroker/lb/backend_server_add.go index c564e81..19c6691 100644 --- a/pkg/cloudbroker/lb/backend_server_add.go +++ b/pkg/cloudbroker/lb/backend_server_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendServerAddRequest struct to add server definition to the backend diff --git a/pkg/cloudbroker/lb/backend_server_delete.go b/pkg/cloudbroker/lb/backend_server_delete.go index 92e328f..474655c 100644 --- a/pkg/cloudbroker/lb/backend_server_delete.go +++ b/pkg/cloudbroker/lb/backend_server_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendServerDeleteRequest struct to delete server definition diff --git a/pkg/cloudbroker/lb/backend_server_update.go b/pkg/cloudbroker/lb/backend_server_update.go index 2d7d6ad..5e60050 100644 --- a/pkg/cloudbroker/lb/backend_server_update.go +++ b/pkg/cloudbroker/lb/backend_server_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendServerUpdateRequest struct to update server diff --git a/pkg/cloudbroker/lb/backend_update.go b/pkg/cloudbroker/lb/backend_update.go index e16d5c8..b1af616 100644 --- a/pkg/cloudbroker/lb/backend_update.go +++ b/pkg/cloudbroker/lb/backend_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // BackendUpdateRequest struct to update backend diff --git a/pkg/cloudbroker/lb/config_reset.go b/pkg/cloudbroker/lb/config_reset.go index 0377d6f..bee1e37 100644 --- a/pkg/cloudbroker/lb/config_reset.go +++ b/pkg/cloudbroker/lb/config_reset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ConfigResetRequest struct to reset config diff --git a/pkg/cloudbroker/lb/create.go b/pkg/cloudbroker/lb/create.go index 8b35c24..faae764 100644 --- a/pkg/cloudbroker/lb/create.go +++ b/pkg/cloudbroker/lb/create.go @@ -7,7 +7,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create load balancer diff --git a/pkg/cloudbroker/lb/delete.go b/pkg/cloudbroker/lb/delete.go index 0ae9f7e..832c101 100644 --- a/pkg/cloudbroker/lb/delete.go +++ b/pkg/cloudbroker/lb/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete load balancer diff --git a/pkg/cloudbroker/lb/disable.go b/pkg/cloudbroker/lb/disable.go index 23d2661..74256a7 100644 --- a/pkg/cloudbroker/lb/disable.go +++ b/pkg/cloudbroker/lb/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable load balancer diff --git a/pkg/cloudbroker/lb/enable.go b/pkg/cloudbroker/lb/enable.go index d675b41..8b79c47 100644 --- a/pkg/cloudbroker/lb/enable.go +++ b/pkg/cloudbroker/lb/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable load balancer diff --git a/pkg/cloudbroker/lb/filter.go b/pkg/cloudbroker/lb/filter.go index e46da50..92e0a0e 100644 --- a/pkg/cloudbroker/lb/filter.go +++ b/pkg/cloudbroker/lb/filter.go @@ -3,8 +3,8 @@ package lb import ( "context" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/k8s" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/k8s" ) // FilterByID returns ListLB with specified ID. diff --git a/pkg/cloudbroker/lb/frontend_bind.go b/pkg/cloudbroker/lb/frontend_bind.go index 61facfd..3965499 100644 --- a/pkg/cloudbroker/lb/frontend_bind.go +++ b/pkg/cloudbroker/lb/frontend_bind.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendBindRequest struct for frontend bind diff --git a/pkg/cloudbroker/lb/frontend_bind_delete.go b/pkg/cloudbroker/lb/frontend_bind_delete.go index 33b5c2a..61f78ca 100644 --- a/pkg/cloudbroker/lb/frontend_bind_delete.go +++ b/pkg/cloudbroker/lb/frontend_bind_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendBindDeleteRequest struct to delete bind diff --git a/pkg/cloudbroker/lb/frontend_binding_update.go b/pkg/cloudbroker/lb/frontend_binding_update.go index 78e7773..976e004 100644 --- a/pkg/cloudbroker/lb/frontend_binding_update.go +++ b/pkg/cloudbroker/lb/frontend_binding_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendBindUpdateRequest struct for update binding diff --git a/pkg/cloudbroker/lb/frontend_create.go b/pkg/cloudbroker/lb/frontend_create.go index a47937c..56fdf91 100644 --- a/pkg/cloudbroker/lb/frontend_create.go +++ b/pkg/cloudbroker/lb/frontend_create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendCreateRequest struct for create frontend diff --git a/pkg/cloudbroker/lb/frontend_delete.go b/pkg/cloudbroker/lb/frontend_delete.go index 79ee113..de1a09e 100644 --- a/pkg/cloudbroker/lb/frontend_delete.go +++ b/pkg/cloudbroker/lb/frontend_delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // FrontendDeleteRequest struct for delete frontend diff --git a/pkg/cloudbroker/lb/get.go b/pkg/cloudbroker/lb/get.go index fa6fe96..798d236 100644 --- a/pkg/cloudbroker/lb/get.go +++ b/pkg/cloudbroker/lb/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about load balancer diff --git a/pkg/cloudbroker/lb/lb.go b/pkg/cloudbroker/lb/lb.go index be32875..b3a45c1 100644 --- a/pkg/cloudbroker/lb/lb.go +++ b/pkg/cloudbroker/lb/lb.go @@ -1,7 +1,7 @@ // API to manage load balancer instance package lb -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to load balancer type LB struct { diff --git a/pkg/cloudbroker/lb/list.go b/pkg/cloudbroker/lb/list.go index ae0547d..f3b8519 100644 --- a/pkg/cloudbroker/lb/list.go +++ b/pkg/cloudbroker/lb/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of load balancers diff --git a/pkg/cloudbroker/lb/list_deleted.go b/pkg/cloudbroker/lb/list_deleted.go index bceb0f6..32e29d1 100644 --- a/pkg/cloudbroker/lb/list_deleted.go +++ b/pkg/cloudbroker/lb/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted load balancers diff --git a/pkg/cloudbroker/lb/make_highly_available.go b/pkg/cloudbroker/lb/make_highly_available.go index 65c90d8..1b45a2e 100644 --- a/pkg/cloudbroker/lb/make_highly_available.go +++ b/pkg/cloudbroker/lb/make_highly_available.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // HighlyAvailableRequest struct to make Load Balancer Highly available diff --git a/pkg/cloudbroker/lb/restart.go b/pkg/cloudbroker/lb/restart.go index d2a7975..a3ba0e0 100644 --- a/pkg/cloudbroker/lb/restart.go +++ b/pkg/cloudbroker/lb/restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestartRequest struct to restart load balancer diff --git a/pkg/cloudbroker/lb/restore.go b/pkg/cloudbroker/lb/restore.go index 1f1ed79..28ac598 100644 --- a/pkg/cloudbroker/lb/restore.go +++ b/pkg/cloudbroker/lb/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore load balancer diff --git a/pkg/cloudbroker/lb/serialize.go b/pkg/cloudbroker/lb/serialize.go index 2155333..9a5ba91 100644 --- a/pkg/cloudbroker/lb/serialize.go +++ b/pkg/cloudbroker/lb/serialize.go @@ -3,7 +3,7 @@ package lb import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/lb/start.go b/pkg/cloudbroker/lb/start.go index 19402f8..8340c0a 100644 --- a/pkg/cloudbroker/lb/start.go +++ b/pkg/cloudbroker/lb/start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StartRequest struct to start load balancer diff --git a/pkg/cloudbroker/lb/stop.go b/pkg/cloudbroker/lb/stop.go index 12f9d66..c1f4978 100644 --- a/pkg/cloudbroker/lb/stop.go +++ b/pkg/cloudbroker/lb/stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StopRequest struct to stop load balancer diff --git a/pkg/cloudbroker/lb/update.go b/pkg/cloudbroker/lb/update.go index 853f7a7..f40e5fc 100644 --- a/pkg/cloudbroker/lb/update.go +++ b/pkg/cloudbroker/lb/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update load balancer diff --git a/pkg/cloudbroker/lb/update_sysctl_params.go b/pkg/cloudbroker/lb/update_sysctl_params.go index 3b5466c..f03ac06 100644 --- a/pkg/cloudbroker/lb/update_sysctl_params.go +++ b/pkg/cloudbroker/lb/update_sysctl_params.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateSysctParamsRequest struct to update sysct params for lb diff --git a/pkg/cloudbroker/node.go b/pkg/cloudbroker/node.go index be51e3b..2e48527 100644 --- a/pkg/cloudbroker/node.go +++ b/pkg/cloudbroker/node.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/node" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/node" // Accessing the Node method group func (cb *CloudBroker) Node() *node.Node { diff --git a/pkg/cloudbroker/node/apply_ipmi_action.go b/pkg/cloudbroker/node/apply_ipmi_action.go index 9703691..2b00677 100644 --- a/pkg/cloudbroker/node/apply_ipmi_action.go +++ b/pkg/cloudbroker/node/apply_ipmi_action.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ApplyIpmiActionRequest struct to apply ipmi action on node diff --git a/pkg/cloudbroker/node/consumption.go b/pkg/cloudbroker/node/consumption.go index 0facf11..a9346cf 100644 --- a/pkg/cloudbroker/node/consumption.go +++ b/pkg/cloudbroker/node/consumption.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ConsumptionRequest struct to get node summary by resources and consumption diff --git a/pkg/cloudbroker/node/decommission.go b/pkg/cloudbroker/node/decommission.go index 34b643b..26b69b0 100644 --- a/pkg/cloudbroker/node/decommission.go +++ b/pkg/cloudbroker/node/decommission.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DecommissionRequest struct to set node status to DECOMMISSIONED diff --git a/pkg/cloudbroker/node/enable.go b/pkg/cloudbroker/node/enable.go index 3ff3f0b..a3eb131 100644 --- a/pkg/cloudbroker/node/enable.go +++ b/pkg/cloudbroker/node/enable.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable node from maintenance status to enabled diff --git a/pkg/cloudbroker/node/enable_nodes.go b/pkg/cloudbroker/node/enable_nodes.go index cd4f8f4..27ab78b 100644 --- a/pkg/cloudbroker/node/enable_nodes.go +++ b/pkg/cloudbroker/node/enable_nodes.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableNodesRequest struct to enable nodes from maintenance status to enabled @@ -13,9 +13,9 @@ type EnableNodesRequest struct { // Required: true NIDs []uint64 `url:"nids" json:"nids" validate:"required"` - // Message + // Reason // Required: false - Message string `url:"message,omitempty" json:"message,omitempty"` + Reason string `url:"reason,omitempty" json:"reason,omitempty"` } // EnableNodes enables nodes from maintenance status to enabled diff --git a/pkg/cloudbroker/node/get.go b/pkg/cloudbroker/node/get.go index 89e24a2..8900446 100644 --- a/pkg/cloudbroker/node/get.go +++ b/pkg/cloudbroker/node/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about node diff --git a/pkg/cloudbroker/node/list.go b/pkg/cloudbroker/node/list.go index 5d26779..5db883d 100644 --- a/pkg/cloudbroker/node/list.go +++ b/pkg/cloudbroker/node/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of nodes diff --git a/pkg/cloudbroker/node/maintenance.go b/pkg/cloudbroker/node/maintenance.go index 9462a50..7aca872 100644 --- a/pkg/cloudbroker/node/maintenance.go +++ b/pkg/cloudbroker/node/maintenance.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MaintenanceRequest struct to place node in maintenance state @@ -23,10 +23,6 @@ type MaintenanceRequest struct { // Required: false Offline bool `url:"offline" json:"offline"` - // VDiskAction - // Required: false - VDiskAction string `url:"vdiskaction,omitempty" json:"vdiskaction,omitempty"` - // Reason // Required: false Reason string `url:"reason,omitempty" json:"reason,omitempty"` diff --git a/pkg/cloudbroker/node/models.go b/pkg/cloudbroker/node/models.go index 9835010..6f4c5cf 100644 --- a/pkg/cloudbroker/node/models.go +++ b/pkg/cloudbroker/node/models.go @@ -371,7 +371,7 @@ type Bridges struct { // Backplane1 type Backplane1 struct { Interfaces []string `json:"interfaces"` - NumaNode uint64 `json:"numa_node"` + NumaNode int64 `json:"numa_node"` } // Role diff --git a/pkg/cloudbroker/node/node.go b/pkg/cloudbroker/node/node.go index a222f21..744c481 100644 --- a/pkg/cloudbroker/node/node.go +++ b/pkg/cloudbroker/node/node.go @@ -2,7 +2,7 @@ package node import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to node diff --git a/pkg/cloudbroker/node/restrict.go b/pkg/cloudbroker/node/restrict.go index 712e779..74e5edd 100644 --- a/pkg/cloudbroker/node/restrict.go +++ b/pkg/cloudbroker/node/restrict.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestrictRequest struct to set node status to 'RESTRICTED' diff --git a/pkg/cloudbroker/node/serialize.go b/pkg/cloudbroker/node/serialize.go index 8ce49e2..292f3bb 100644 --- a/pkg/cloudbroker/node/serialize.go +++ b/pkg/cloudbroker/node/serialize.go @@ -3,7 +3,7 @@ package node import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/node/set_core_isolation.go b/pkg/cloudbroker/node/set_core_isolation.go index baa1ea5..209fd35 100644 --- a/pkg/cloudbroker/node/set_core_isolation.go +++ b/pkg/cloudbroker/node/set_core_isolation.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCoreIsolationRequest struct to isolate selected cores on node boot diff --git a/pkg/cloudbroker/node/set_huge_pages.go b/pkg/cloudbroker/node/set_huge_pages.go index 62c8c5c..904f1f4 100644 --- a/pkg/cloudbroker/node/set_huge_pages.go +++ b/pkg/cloudbroker/node/set_huge_pages.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetHugePagesRequest struct to set on-boot Huge Pages configuration diff --git a/pkg/cloudbroker/node/set_sriov_status.go b/pkg/cloudbroker/node/set_sriov_status.go index 2135edf..97da27f 100644 --- a/pkg/cloudbroker/node/set_sriov_status.go +++ b/pkg/cloudbroker/node/set_sriov_status.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetSRIOVStatusRequest struct to set Single-root input/output virtualization kernel config on node diff --git a/pkg/cloudbroker/node/set_vfs_number.go b/pkg/cloudbroker/node/set_vfs_number.go index 1216779..d99bc3d 100644 --- a/pkg/cloudbroker/node/set_vfs_number.go +++ b/pkg/cloudbroker/node/set_vfs_number.go @@ -3,8 +3,9 @@ package node import ( "context" "net/http" + "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetVFsNumberRequest struct to set number of VFs for individual NIC on node @@ -15,34 +16,36 @@ type SetVFsNumberRequest struct { // PCI address or NIC name // Required: true - NicID string `url:"nicId" json:"nicId" validate:"required"` + NICID string `url:"nicId" json:"nicId" validate:"required"` // Number of VF to assign // Required: true VFNum uint64 `url:"vfNum" json:"vfNum" validate:"required"` - // Trust - // Required: true - Trust bool `url:"trust" json:"trust" validate:"required"` - - // Enable spoof checking + // Number of VF to assign // Required: true - Spoofchk bool `url:"spoofchk" json:"spoofchk" validate:"required"` + VFParams []VFParam `url:"vfParams" json:"vfParams" validate:"required"` } // SetVFsNumber sets number of VFs for individual NIC on node -func (n Node) SetVFsNumber(ctx context.Context, req SetVFsNumberRequest) (string, error) { +func (n Node) SetVFsNumber(ctx context.Context, req SetVFsNumberRequest) (bool, error) { err := validators.ValidateRequest(req) if err != nil { - return "", validators.ValidationErrors(validators.GetErrors(err)) + return false, validators.ValidationErrors(validators.GetErrors(err)) } url := "/cloudbroker/node/setVFsNumber" res, err := n.client.DecortApiCall(ctx, http.MethodPost, url, req) + + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) if err != nil { - return "", err + return false, err } - return string(res), nil + return result, nil } diff --git a/pkg/cloudbroker/node/set_vfs_params.go b/pkg/cloudbroker/node/set_vfs_params.go new file mode 100644 index 0000000..4a449c0 --- /dev/null +++ b/pkg/cloudbroker/node/set_vfs_params.go @@ -0,0 +1,61 @@ +package node + +import ( + "context" + "net/http" + "strconv" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +type VFParam struct { + // Number of VF to assign + // Required: true + VFNum uint64 `url:"vfNum" json:"vfNum" validate:"required"` + + // Trust + // Required: true + Trust bool `url:"trust" json:"trust" validate:"required"` + + // Enable spoof checking + // Required: true + SpoofChk bool `url:"spoofchk" json:"spoofchk" validate:"required"` +} + +// SetVFsParamsRequest struct to set params of VFs for individual NIC on node +type SetVFsParamsRequest struct { + // Node ID + // Required: true + NID uint64 `url:"nid" json:"nid" validate:"required"` + + // PCI address or NIC name + // Required: true + NICID string `url:"nicId" json:"nicId" validate:"required"` + + // Number of VF to assign + // Required: true + VFParams []VFParam `url:"vfParams" json:"vfParams" validate:"required"` +} + +// SetVFsParams sets params of VFs for individual NIC on node +func (n Node) SetVFsParams(ctx context.Context, req SetVFsParamsRequest) (bool, error) { + err := validators.ValidateRequest(req) + if err != nil { + return false, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/node/setVFsParams" + + res, err := n.client.DecortApiCall(ctx, http.MethodPost, url, req) + + if err != nil { + return false, err + } + + result, err := strconv.ParseBool(string(res)) + if err != nil { + return false, err + } + + return result, nil +} diff --git a/pkg/cloudbroker/node/update.go b/pkg/cloudbroker/node/update.go index 91d222f..51e55c8 100644 --- a/pkg/cloudbroker/node/update.go +++ b/pkg/cloudbroker/node/update.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update node for actual version diff --git a/pkg/cloudbroker/pcidevice.go b/pkg/cloudbroker/pcidevice.go index 0a013ce..2b38c08 100644 --- a/pkg/cloudbroker/pcidevice.go +++ b/pkg/cloudbroker/pcidevice.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/pcidevice" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/pcidevice" // Accessing the PCI Device method group func (cb *CloudBroker) PCIDevice() *pcidevice.PCIDevice { diff --git a/pkg/cloudbroker/pcidevice/create.go b/pkg/cloudbroker/pcidevice/create.go index 7b2b7ea..d8d3c32 100644 --- a/pkg/cloudbroker/pcidevice/create.go +++ b/pkg/cloudbroker/pcidevice/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to creating PCI device diff --git a/pkg/cloudbroker/pcidevice/delete.go b/pkg/cloudbroker/pcidevice/delete.go index 5d6aa8e..04131a5 100644 --- a/pkg/cloudbroker/pcidevice/delete.go +++ b/pkg/cloudbroker/pcidevice/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to deleting PCI device diff --git a/pkg/cloudbroker/pcidevice/disable.go b/pkg/cloudbroker/pcidevice/disable.go index 1643cbd..df8609f 100644 --- a/pkg/cloudbroker/pcidevice/disable.go +++ b/pkg/cloudbroker/pcidevice/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct for disabling PCI device diff --git a/pkg/cloudbroker/pcidevice/enable.go b/pkg/cloudbroker/pcidevice/enable.go index 1b8635d..e30ca5b 100644 --- a/pkg/cloudbroker/pcidevice/enable.go +++ b/pkg/cloudbroker/pcidevice/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct for enabling PCI device diff --git a/pkg/cloudbroker/pcidevice/list.go b/pkg/cloudbroker/pcidevice/list.go index 92d3b5d..041c3eb 100644 --- a/pkg/cloudbroker/pcidevice/list.go +++ b/pkg/cloudbroker/pcidevice/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of pci devices diff --git a/pkg/cloudbroker/pcidevice/pcidevice.go b/pkg/cloudbroker/pcidevice/pcidevice.go index 3e16d35..7a42767 100644 --- a/pkg/cloudbroker/pcidevice/pcidevice.go +++ b/pkg/cloudbroker/pcidevice/pcidevice.go @@ -1,6 +1,6 @@ package pcidevice -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to PCI device type PCIDevice struct { diff --git a/pkg/cloudbroker/pcidevice/serialize.go b/pkg/cloudbroker/pcidevice/serialize.go index aea3039..56be05c 100644 --- a/pkg/cloudbroker/pcidevice/serialize.go +++ b/pkg/cloudbroker/pcidevice/serialize.go @@ -3,7 +3,7 @@ package pcidevice import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/prometheus.go b/pkg/cloudbroker/prometheus.go index dcb57ca..d5f21af 100644 --- a/pkg/cloudbroker/prometheus.go +++ b/pkg/cloudbroker/prometheus.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/prometheus" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/prometheus" // Accessing the Prometheus method group func (cb *CloudBroker) Prometheus() *prometheus.Prometheus { diff --git a/pkg/cloudbroker/prometheus/compute_cpu_load.go b/pkg/cloudbroker/prometheus/compute_cpu_load.go index 3beb212..d70070a 100644 --- a/pkg/cloudbroker/prometheus/compute_cpu_load.go +++ b/pkg/cloudbroker/prometheus/compute_cpu_load.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeCPULoadRequest struct { diff --git a/pkg/cloudbroker/prometheus/compute_memory_available.go b/pkg/cloudbroker/prometheus/compute_memory_available.go index 85062b1..3c4bc67 100644 --- a/pkg/cloudbroker/prometheus/compute_memory_available.go +++ b/pkg/cloudbroker/prometheus/compute_memory_available.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeMemoryAvailableRequest struct { @@ -18,7 +18,7 @@ type ComputeMemoryAvailableRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_memory_unused.go b/pkg/cloudbroker/prometheus/compute_memory_unused.go index 6517d6e..d2e20e7 100644 --- a/pkg/cloudbroker/prometheus/compute_memory_unused.go +++ b/pkg/cloudbroker/prometheus/compute_memory_unused.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeMemoryUnusedRequest struct { @@ -18,7 +18,7 @@ type ComputeMemoryUnusedRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_memory_usable.go b/pkg/cloudbroker/prometheus/compute_memory_usable.go index 703a26f..8d2a9ca 100644 --- a/pkg/cloudbroker/prometheus/compute_memory_usable.go +++ b/pkg/cloudbroker/prometheus/compute_memory_usable.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeMemoryUsableRequest struct { @@ -18,7 +18,7 @@ type ComputeMemoryUsableRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_memory_usage.go b/pkg/cloudbroker/prometheus/compute_memory_usage.go index 474745b..048d10c 100644 --- a/pkg/cloudbroker/prometheus/compute_memory_usage.go +++ b/pkg/cloudbroker/prometheus/compute_memory_usage.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeMemoryUsageRequest struct { @@ -18,7 +18,7 @@ type ComputeMemoryUsageRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_memory_used.go b/pkg/cloudbroker/prometheus/compute_memory_used.go index 78797e0..a0bed83 100644 --- a/pkg/cloudbroker/prometheus/compute_memory_used.go +++ b/pkg/cloudbroker/prometheus/compute_memory_used.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeMemoryUsedRequest struct { @@ -18,7 +18,7 @@ type ComputeMemoryUsedRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_read_bytes.go b/pkg/cloudbroker/prometheus/compute_read_bytes.go index 7e8e095..1d5b4be 100644 --- a/pkg/cloudbroker/prometheus/compute_read_bytes.go +++ b/pkg/cloudbroker/prometheus/compute_read_bytes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeReadBytesRequest struct { @@ -18,11 +18,11 @@ type ComputeReadBytesRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_read_requests.go b/pkg/cloudbroker/prometheus/compute_read_requests.go index f5078fc..06b500e 100644 --- a/pkg/cloudbroker/prometheus/compute_read_requests.go +++ b/pkg/cloudbroker/prometheus/compute_read_requests.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeReadRequestsRequest struct { @@ -18,11 +18,11 @@ type ComputeReadRequestsRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_receive_bytes.go b/pkg/cloudbroker/prometheus/compute_receive_bytes.go index e1543a1..6de2e5e 100644 --- a/pkg/cloudbroker/prometheus/compute_receive_bytes.go +++ b/pkg/cloudbroker/prometheus/compute_receive_bytes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeReceiveBytesRequest struct { @@ -18,11 +18,11 @@ type ComputeReceiveBytesRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_receive_packets.go b/pkg/cloudbroker/prometheus/compute_receive_packets.go index 79bf033..9f2095f 100644 --- a/pkg/cloudbroker/prometheus/compute_receive_packets.go +++ b/pkg/cloudbroker/prometheus/compute_receive_packets.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeReceivePacketsRequest struct { @@ -18,11 +18,11 @@ type ComputeReceivePacketsRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_transmit_bytes.go b/pkg/cloudbroker/prometheus/compute_transmit_bytes.go index 7a940d5..b868ad0 100644 --- a/pkg/cloudbroker/prometheus/compute_transmit_bytes.go +++ b/pkg/cloudbroker/prometheus/compute_transmit_bytes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeTransmitBytesRequest struct { @@ -18,11 +18,11 @@ type ComputeTransmitBytesRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_transmit_packets.go b/pkg/cloudbroker/prometheus/compute_transmit_packets.go index abcde35..c6e7914 100644 --- a/pkg/cloudbroker/prometheus/compute_transmit_packets.go +++ b/pkg/cloudbroker/prometheus/compute_transmit_packets.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeTransmitPacketsRequest struct { @@ -18,11 +18,11 @@ type ComputeTransmitPacketsRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_write_bytes.go b/pkg/cloudbroker/prometheus/compute_write_bytes.go index 87c157f..a0b9712 100644 --- a/pkg/cloudbroker/prometheus/compute_write_bytes.go +++ b/pkg/cloudbroker/prometheus/compute_write_bytes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeWriteBytesRequest struct { @@ -18,11 +18,11 @@ type ComputeWriteBytesRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/compute_write_requests.go b/pkg/cloudbroker/prometheus/compute_write_requests.go index 154feb6..abfadb3 100644 --- a/pkg/cloudbroker/prometheus/compute_write_requests.go +++ b/pkg/cloudbroker/prometheus/compute_write_requests.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type ComputeWriteRequestsRequest struct { @@ -18,11 +18,11 @@ type ComputeWriteRequestsRequest struct { ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` // The reading interval in seconds - // Required: true + // Required: false Step uint64 `url:"step,omitempty" json:"step,omitempty"` // Number of zeros after the decimal point - // Required: true + // Required: false DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` } diff --git a/pkg/cloudbroker/prometheus/computes.go b/pkg/cloudbroker/prometheus/computes.go new file mode 100644 index 0000000..9056cb8 --- /dev/null +++ b/pkg/cloudbroker/prometheus/computes.go @@ -0,0 +1,77 @@ +package prometheus + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +const ( + ComputeCPULoad = "computeCPUload" + ComputeMemoryUsage = "computeMemoryUsage" + ComputeMemoryUsable = "computeMemoryUsable" + ComputeMemoryUnused = "computeMemoryUnused" + ComputeMemoryUsed = "computeMemoryUsed" + ComputeMemoryAvailable = "computeMemoryAvailable" + ComputeReadBytes = "computeReadBytes" + ComputeReadRequests = "computeReadRequests" + ComputeReceiveBytes = "computeReceiveBytes" + ComputeTransmitBytes = "computeTransmitBytes" + ComputeTransmitPackets = "computeTransmitPackets" + ComputeWriteBytes = "computeWriteBytes" + ComputeWriteRequests = "computeWriteRequests" +) + +type ComputesRequest struct { + // List of compute IDs to fetch metrics for + // Required: true + ComputeIDs []uint64 `url:"computeIds" json:"computeIds" validate:"required"` + + // List of compute IDs to fetch metrics for + // Required: true + MetricIDs []string `url:"metricIds" json:"metricIds" validate:"required"` + + // Time to loads of statistic in seconds + // Required: false + ForLast uint64 `url:"forLast,omitempty" json:"forLast,omitempty"` + + // The reading interval in seconds + // Required: false + Step uint64 `url:"step,omitempty" json:"step,omitempty"` + + // Number of zeros after the decimal point + // Required: false + DecimalPlaces uint64 `url:"decimalPlaces,omitempty" json:"decimalPlaces,omitempty"` +} + +// Get multiple metrics for multiple compute instances +func (p Prometheus) Computes(ctx context.Context, req ComputesRequest) (*ComputesData, error) { + res, err := p.ComputesRaw(ctx, req) + if err != nil { + return nil, err + } + + info := ComputesData{} + + err = json.Unmarshal(res, &info) + if err != nil { + return nil, err + } + + return &info, nil +} + +// GetRaw gets information about compute as an array of bytes +func (p Prometheus) ComputesRaw(ctx context.Context, req ComputesRequest) ([]byte, error) { + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/prometheus/computes" + + res, err := p.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudbroker/prometheus/models.go b/pkg/cloudbroker/prometheus/models.go index 6ab647d..76ee3bc 100644 --- a/pkg/cloudbroker/prometheus/models.go +++ b/pkg/cloudbroker/prometheus/models.go @@ -11,3 +11,30 @@ type PrometheusPoint struct { // Timestamp the Unix timestamp. Timestamp uint64 `json:"timestamp"` } + +// ComputesData represents an array of data points for computes +type ComputesData []ItemCompute + +// ItemCompute represents a single data of compute +type ItemCompute struct { + // Compute ID + ComputeID uint64 `json:"computeId"` + + // Array of metrics + Metrics []ItemMetric `json:"metrics"` + + // Error + Error string `json:"error"` +} + +// ItemMetric represents a single data point of metric +type ItemMetric struct { + // Metric ID + MetricID string `json:"metricId"` + + // Data represents an array of data points + Data PrometheusData `json:"data"` + + // Error + Error string `json:"error"` +} diff --git a/pkg/cloudbroker/prometheus/prometheus.go b/pkg/cloudbroker/prometheus/prometheus.go index e8808be..bffc0c2 100644 --- a/pkg/cloudbroker/prometheus/prometheus.go +++ b/pkg/cloudbroker/prometheus/prometheus.go @@ -1,7 +1,7 @@ package prometheus import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to prometheus diff --git a/pkg/cloudbroker/resmon.go b/pkg/cloudbroker/resmon.go index 44a9abe..5d59144 100644 --- a/pkg/cloudbroker/resmon.go +++ b/pkg/cloudbroker/resmon.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/resmon" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/resmon" ) // Accessing the Resmon method group diff --git a/pkg/cloudbroker/resmon/get_by_compute.go b/pkg/cloudbroker/resmon/get_by_compute.go index a7f7031..567a588 100644 --- a/pkg/cloudbroker/resmon/get_by_compute.go +++ b/pkg/cloudbroker/resmon/get_by_compute.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type GetByComputeRequest struct { diff --git a/pkg/cloudbroker/resmon/get_by_computes.go b/pkg/cloudbroker/resmon/get_by_computes.go index 3a9a770..11024e5 100644 --- a/pkg/cloudbroker/resmon/get_by_computes.go +++ b/pkg/cloudbroker/resmon/get_by_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type GetByComputesRequest struct { diff --git a/pkg/cloudbroker/resmon/get_by_grid.go b/pkg/cloudbroker/resmon/get_by_grid.go index ed43c2f..6ae3e07 100644 --- a/pkg/cloudbroker/resmon/get_by_grid.go +++ b/pkg/cloudbroker/resmon/get_by_grid.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type GetByGRIDRequest struct { diff --git a/pkg/cloudbroker/resmon/get_by_stack.go b/pkg/cloudbroker/resmon/get_by_stack.go index 02e2c13..9aac831 100644 --- a/pkg/cloudbroker/resmon/get_by_stack.go +++ b/pkg/cloudbroker/resmon/get_by_stack.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type GetByStackRequest struct { diff --git a/pkg/cloudbroker/resmon/get_by_stacks.go b/pkg/cloudbroker/resmon/get_by_stacks.go index c66fa8c..4bbc9ea 100644 --- a/pkg/cloudbroker/resmon/get_by_stacks.go +++ b/pkg/cloudbroker/resmon/get_by_stacks.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type GetByStacksRequest struct { diff --git a/pkg/cloudbroker/resmon/models.go b/pkg/cloudbroker/resmon/models.go index 5206bc8..399518a 100644 --- a/pkg/cloudbroker/resmon/models.go +++ b/pkg/cloudbroker/resmon/models.go @@ -28,10 +28,12 @@ type ComputeUsage struct { } type ItemDisk struct { - Pool string `json:"pool"` - ResID string `json:"resId"` - SizeUsed uint64 `json:"sizeUsed"` - SizeMax uint64 `json:"sizeMax"` + ID uint64 `json:"id"` + Pool string `json:"pool"` + ResID string `json:"resId"` + SizeUsed float64 `json:"sizeUsed"` + SizeAvailable float64 `json:"sizeAvailable"` + SizeMax float64 `json:"sizeMax"` } // GetByGRIDData represents an array of data points diff --git a/pkg/cloudbroker/resmon/resmon.go b/pkg/cloudbroker/resmon/resmon.go index b28e684..b46ff74 100644 --- a/pkg/cloudbroker/resmon/resmon.go +++ b/pkg/cloudbroker/resmon/resmon.go @@ -1,6 +1,6 @@ package resmon -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to resource monitoring type Resmon struct { diff --git a/pkg/cloudbroker/rg.go b/pkg/cloudbroker/rg.go index 5a2160f..7b92a05 100644 --- a/pkg/cloudbroker/rg.go +++ b/pkg/cloudbroker/rg.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/rg" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/rg" // Accessing the RG method group func (cb *CloudBroker) RG() *rg.RG { diff --git a/pkg/cloudbroker/rg/access_grant.go b/pkg/cloudbroker/rg/access_grant.go index c402018..9c8a6de 100644 --- a/pkg/cloudbroker/rg/access_grant.go +++ b/pkg/cloudbroker/rg/access_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessGrantRequest struct to grant access to resource group diff --git a/pkg/cloudbroker/rg/access_revoke.go b/pkg/cloudbroker/rg/access_revoke.go index 313fae0..41fbde4 100644 --- a/pkg/cloudbroker/rg/access_revoke.go +++ b/pkg/cloudbroker/rg/access_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessRevokeRequest struct to revoke access diff --git a/pkg/cloudbroker/rg/affinity_group_computes.go b/pkg/cloudbroker/rg/affinity_group_computes.go index cd8ff08..ae98a3f 100644 --- a/pkg/cloudbroker/rg/affinity_group_computes.go +++ b/pkg/cloudbroker/rg/affinity_group_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupComputesRequest struct to get list of all computes with their relationships diff --git a/pkg/cloudbroker/rg/affinity_groups_get.go b/pkg/cloudbroker/rg/affinity_groups_get.go index c2c2846..c7b120c 100644 --- a/pkg/cloudbroker/rg/affinity_groups_get.go +++ b/pkg/cloudbroker/rg/affinity_groups_get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupsGetRequest struct to get list of computes from affinity group diff --git a/pkg/cloudbroker/rg/affinity_groups_list.go b/pkg/cloudbroker/rg/affinity_groups_list.go index f65ea4a..cffc95d 100644 --- a/pkg/cloudbroker/rg/affinity_groups_list.go +++ b/pkg/cloudbroker/rg/affinity_groups_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AffinityGroupsListRequest struct to get list of affinity groups from resource group diff --git a/pkg/cloudbroker/rg/audits.go b/pkg/cloudbroker/rg/audits.go index c8bf86e..f419793 100644 --- a/pkg/cloudbroker/rg/audits.go +++ b/pkg/cloudbroker/rg/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to get audit diff --git a/pkg/cloudbroker/rg/create.go b/pkg/cloudbroker/rg/create.go index 15f5385..173d039 100644 --- a/pkg/cloudbroker/rg/create.go +++ b/pkg/cloudbroker/rg/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create resource group @@ -68,16 +68,12 @@ type CreateRequest struct { // Required: false ExtIP string `url:"extIp,omitempty" json:"extIp,omitempty"` - // Register computes in registration system - // Required: false - RegisterComputes bool `url:"registerComputes,omitempty" json:"registerComputes,omitempty"` - // List of strings with pools i.e.: ["sep1_poolName1", "sep2_poolName2"] // Required: false UniqPools []string `url:"uniqPools,omitempty" json:"uniqPools,omitempty"` // Advanced compute features, - // one of: hugepages, numa, cpupin, vfnic + // one of: hugepages, numa, cpupin, vfnic, dpdk, changemac // Required: false ComputeFeatures []string `url:"computeFeatures,omitempty" json:"computeFeatures,omitempty" validate:"omitempty,computeFeatures"` } diff --git a/pkg/cloudbroker/rg/delete.go b/pkg/cloudbroker/rg/delete.go index 0d064c2..c0cd6a7 100644 --- a/pkg/cloudbroker/rg/delete.go +++ b/pkg/cloudbroker/rg/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete resource group diff --git a/pkg/cloudbroker/rg/disable.go b/pkg/cloudbroker/rg/disable.go index 1e73a8d..172fbb2 100644 --- a/pkg/cloudbroker/rg/disable.go +++ b/pkg/cloudbroker/rg/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable resource group diff --git a/pkg/cloudbroker/rg/enable.go b/pkg/cloudbroker/rg/enable.go index e19699c..579ff0a 100644 --- a/pkg/cloudbroker/rg/enable.go +++ b/pkg/cloudbroker/rg/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable resource group diff --git a/pkg/cloudbroker/rg/filter_test.go b/pkg/cloudbroker/rg/filter_test.go index f206af6..f4b3b1f 100644 --- a/pkg/cloudbroker/rg/filter_test.go +++ b/pkg/cloudbroker/rg/filter_test.go @@ -17,20 +17,19 @@ var rgs = ListRG{ UserGroupID: "sample_user_1@decs3o", }, }, - CreatedBy: "sample_user_1@decs3o", - CreatedTime: 1676645305, - DefNetID: 1, - DefNetType: "NONE", - DeletedBy: "", - DeletedTime: 0, - Description: "", - GID: 212, - GUID: 7971, - ID: 7971, - LockStatus: "UNLOCKED", - Milestones: 363459, - Name: "rg_1", - RegisterComputes: false, + CreatedBy: "sample_user_1@decs3o", + CreatedTime: 1676645305, + DefNetID: 1, + DefNetType: "NONE", + DeletedBy: "", + DeletedTime: 0, + Description: "", + GID: 212, + GUID: 7971, + ID: 7971, + LockStatus: "UNLOCKED", + Milestones: 363459, + Name: "rg_1", ResourceLimits: ResourceLimits{ CUC: -1, CuD: -1, @@ -61,20 +60,19 @@ var rgs = ListRG{ UserGroupID: "sample_user_1@decs3o", }, }, - CreatedBy: "sample_user_1@decs3o", - CreatedTime: 1676645461, - DefNetID: 2, - DefNetType: "NONE", - DeletedBy: "", - DeletedTime: 0, - Description: "", - GID: 212, - GUID: 7972, - ID: 7972, - LockStatus: "UNLOCKED", - Milestones: 363468, - Name: "rg_2", - RegisterComputes: false, + CreatedBy: "sample_user_1@decs3o", + CreatedTime: 1676645461, + DefNetID: 2, + DefNetType: "NONE", + DeletedBy: "", + DeletedTime: 0, + Description: "", + GID: 212, + GUID: 7972, + ID: 7972, + LockStatus: "UNLOCKED", + Milestones: 363468, + Name: "rg_2", ResourceLimits: ResourceLimits{ CUC: -1, CuD: -1, @@ -105,20 +103,19 @@ var rgs = ListRG{ UserGroupID: "sample_user_2@decs3o", }, }, - CreatedBy: "sample_user_2@decs3o", - CreatedTime: 1676645548, - DefNetID: 3, - DefNetType: "NONE", - DeletedBy: "", - DeletedTime: 0, - Description: "", - GID: 212, - GUID: 7973, - ID: 7973, - LockStatus: "kjLOCKED", - Milestones: 363471, - Name: "rg_3", - RegisterComputes: false, + CreatedBy: "sample_user_2@decs3o", + CreatedTime: 1676645548, + DefNetID: 3, + DefNetType: "NONE", + DeletedBy: "", + DeletedTime: 0, + Description: "", + GID: 212, + GUID: 7973, + ID: 7973, + LockStatus: "kjLOCKED", + Milestones: 363471, + Name: "rg_3", ResourceLimits: ResourceLimits{ CUC: -1, CuD: -1, diff --git a/pkg/cloudbroker/rg/get.go b/pkg/cloudbroker/rg/get.go index 29bfcd4..68f706b 100644 --- a/pkg/cloudbroker/rg/get.go +++ b/pkg/cloudbroker/rg/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about resource group diff --git a/pkg/cloudbroker/rg/get_resource_consumption.go b/pkg/cloudbroker/rg/get_resource_consumption.go index f857939..c556419 100644 --- a/pkg/cloudbroker/rg/get_resource_consumption.go +++ b/pkg/cloudbroker/rg/get_resource_consumption.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetResourceConsumptionRequest struct to get detailed information about resource consumption for ResGroup diff --git a/pkg/cloudbroker/rg/list.go b/pkg/cloudbroker/rg/list.go index e432746..dd6c9dd 100644 --- a/pkg/cloudbroker/rg/list.go +++ b/pkg/cloudbroker/rg/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of resource groups diff --git a/pkg/cloudbroker/rg/list_computes.go b/pkg/cloudbroker/rg/list_computes.go index 0ccaf07..82d807c 100644 --- a/pkg/cloudbroker/rg/list_computes.go +++ b/pkg/cloudbroker/rg/list_computes.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListComputesRequest struct to get list of computes diff --git a/pkg/cloudbroker/rg/list_deleted.go b/pkg/cloudbroker/rg/list_deleted.go index 2b653c8..d12818a 100644 --- a/pkg/cloudbroker/rg/list_deleted.go +++ b/pkg/cloudbroker/rg/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted resource groups diff --git a/pkg/cloudbroker/rg/list_lb.go b/pkg/cloudbroker/rg/list_lb.go index 1046442..2ab3e6a 100644 --- a/pkg/cloudbroker/rg/list_lb.go +++ b/pkg/cloudbroker/rg/list_lb.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListLBRequest struct to get list of load balancers diff --git a/pkg/cloudbroker/rg/list_pfw.go b/pkg/cloudbroker/rg/list_pfw.go index 98f22db..97da9cb 100644 --- a/pkg/cloudbroker/rg/list_pfw.go +++ b/pkg/cloudbroker/rg/list_pfw.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListPFWRequest struct to get list of port forward rules diff --git a/pkg/cloudbroker/rg/list_vins.go b/pkg/cloudbroker/rg/list_vins.go index 597729a..4cfa256 100644 --- a/pkg/cloudbroker/rg/list_vins.go +++ b/pkg/cloudbroker/rg/list_vins.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListVINSRequest struct to get list of VINSes diff --git a/pkg/cloudbroker/rg/mass_delete.go b/pkg/cloudbroker/rg/mass_delete.go index 2778496..5672124 100644 --- a/pkg/cloudbroker/rg/mass_delete.go +++ b/pkg/cloudbroker/rg/mass_delete.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassDeleteRequest struct to delete several resource groups diff --git a/pkg/cloudbroker/rg/mass_disable.go b/pkg/cloudbroker/rg/mass_disable.go index 9213d49..1f7cdcc 100644 --- a/pkg/cloudbroker/rg/mass_disable.go +++ b/pkg/cloudbroker/rg/mass_disable.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassDisableRequest struct to disable several resource groups diff --git a/pkg/cloudbroker/rg/mass_enable.go b/pkg/cloudbroker/rg/mass_enable.go index dfce85a..5950e8d 100644 --- a/pkg/cloudbroker/rg/mass_enable.go +++ b/pkg/cloudbroker/rg/mass_enable.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassEnableRequest struct to enable several resource groups diff --git a/pkg/cloudbroker/rg/models.go b/pkg/cloudbroker/rg/models.go index d0d541b..c09ea4e 100644 --- a/pkg/cloudbroker/rg/models.go +++ b/pkg/cloudbroker/rg/models.go @@ -196,9 +196,6 @@ type ItemRG struct { // Name Name string `json:"name"` - // Register computes - RegisterComputes bool `json:"registerComputes"` - // Resource limits ResourceLimits ResourceLimits `json:"resourceLimits"` diff --git a/pkg/cloudbroker/rg/remove_def_net.go b/pkg/cloudbroker/rg/remove_def_net.go index 22c63bc..4ab2313 100644 --- a/pkg/cloudbroker/rg/remove_def_net.go +++ b/pkg/cloudbroker/rg/remove_def_net.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RemoveDefNetRequest struct to remove default network diff --git a/pkg/cloudbroker/rg/restore.go b/pkg/cloudbroker/rg/restore.go index 0ebdc00..805bfa5 100644 --- a/pkg/cloudbroker/rg/restore.go +++ b/pkg/cloudbroker/rg/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct to restore resource group diff --git a/pkg/cloudbroker/rg/rg.go b/pkg/cloudbroker/rg/rg.go index d1c3bce..c83074f 100644 --- a/pkg/cloudbroker/rg/rg.go +++ b/pkg/cloudbroker/rg/rg.go @@ -2,7 +2,7 @@ package rg import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to resource group diff --git a/pkg/cloudbroker/rg/serialize.go b/pkg/cloudbroker/rg/serialize.go index 9594cff..74b70de 100644 --- a/pkg/cloudbroker/rg/serialize.go +++ b/pkg/cloudbroker/rg/serialize.go @@ -3,7 +3,7 @@ package rg import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go b/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go index c08dc40..c0b0410 100644 --- a/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go +++ b/pkg/cloudbroker/rg/set_cpu_allocation_parameter.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCPUAllocationParameterRequest struct for setting CPU allocation parameter diff --git a/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go b/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go index 74bc2e7..40820b6 100644 --- a/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go +++ b/pkg/cloudbroker/rg/set_cpu_allocation_ratio.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCPUAllocationRatioRequest struct for setting CPU allocation ratio diff --git a/pkg/cloudbroker/rg/set_def_net.go b/pkg/cloudbroker/rg/set_def_net.go index b2ada6d..3de86f5 100644 --- a/pkg/cloudbroker/rg/set_def_net.go +++ b/pkg/cloudbroker/rg/set_def_net.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetDefNetRequest struct to set default network diff --git a/pkg/cloudbroker/rg/update.go b/pkg/cloudbroker/rg/update.go index a73509d..d843699 100644 --- a/pkg/cloudbroker/rg/update.go +++ b/pkg/cloudbroker/rg/update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update resource group @@ -42,10 +42,6 @@ type UpdateRequest struct { // Required: false MaxNumPublicIP int64 `url:"maxNumPublicIP,omitempty" json:"maxNumPublicIP,omitempty"` - // Register computes in registration system - // Required: false - RegisterComputes bool `url:"registerComputes,omitempty" json:"registerComputes,omitempty"` - // List of strings with pools i.e.: ["sep1_poolName1", "sep2_poolName2", etc] // Required: false UniqPools []string `url:"uniqPools,omitempty" json:"uniqPools,omitempty"` diff --git a/pkg/cloudbroker/rg/update_compute_features.go b/pkg/cloudbroker/rg/update_compute_features.go index 9e85f37..5afef70 100644 --- a/pkg/cloudbroker/rg/update_compute_features.go +++ b/pkg/cloudbroker/rg/update_compute_features.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateComputeFeaturesRequest struct to update advanced compute features @@ -15,7 +15,7 @@ type UpdateComputeFeaturesRequest struct { RGID uint64 `url:"rgId" json:"rgId" validate:"required"` // Advanced compute features, - // one of: hugepages, numa, cpupin, vfnic + // one of: hugepages, numa, cpupin, vfnic, dpdk, changemac // Required: false ComputeFeatures []string `url:"computeFeatures,omitempty" json:"computeFeatures,omitempty" validate:"omitempty,computeFeatures"` } diff --git a/pkg/cloudbroker/rg/update_resource_types.go b/pkg/cloudbroker/rg/update_resource_types.go index ef8c92d..66ea0a0 100644 --- a/pkg/cloudbroker/rg/update_resource_types.go +++ b/pkg/cloudbroker/rg/update_resource_types.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateResourceTypesRequest struct to update resource types in account diff --git a/pkg/cloudbroker/rg/usage.go b/pkg/cloudbroker/rg/usage.go index ac77282..8320d35 100644 --- a/pkg/cloudbroker/rg/usage.go +++ b/pkg/cloudbroker/rg/usage.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UsageRequest struct to get report of resource usage diff --git a/pkg/cloudbroker/sep.go b/pkg/cloudbroker/sep.go index 1aa180f..2d5c513 100644 --- a/pkg/cloudbroker/sep.go +++ b/pkg/cloudbroker/sep.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/sep" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/sep" // Accessing the SEP method group func (cb *CloudBroker) SEP() *sep.SEP { diff --git a/pkg/cloudbroker/sep/access_grant.go b/pkg/cloudbroker/sep/access_grant.go index f12e3aa..14d5af4 100644 --- a/pkg/cloudbroker/sep/access_grant.go +++ b/pkg/cloudbroker/sep/access_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessGrantRequest struct to grant access to SEP diff --git a/pkg/cloudbroker/sep/access_grant_to_pool.go b/pkg/cloudbroker/sep/access_grant_to_pool.go index c54f5c1..ee33450 100644 --- a/pkg/cloudbroker/sep/access_grant_to_pool.go +++ b/pkg/cloudbroker/sep/access_grant_to_pool.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessGrantToPoolRequest struct to grant access to pool SEP diff --git a/pkg/cloudbroker/sep/access_revoke.go b/pkg/cloudbroker/sep/access_revoke.go index 27ebca5..94e96c1 100644 --- a/pkg/cloudbroker/sep/access_revoke.go +++ b/pkg/cloudbroker/sep/access_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessRevokeRequest struct to revoke access to SEP diff --git a/pkg/cloudbroker/sep/access_revoke_to_pool.go b/pkg/cloudbroker/sep/access_revoke_to_pool.go index 73e98d5..64d701b 100644 --- a/pkg/cloudbroker/sep/access_revoke_to_pool.go +++ b/pkg/cloudbroker/sep/access_revoke_to_pool.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AccessRevokeToPoolRequest struct to revoke access to pool SEP diff --git a/pkg/cloudbroker/sep/add_consumer_nodes.go b/pkg/cloudbroker/sep/add_consumer_nodes.go index 6995559..047518b 100644 --- a/pkg/cloudbroker/sep/add_consumer_nodes.go +++ b/pkg/cloudbroker/sep/add_consumer_nodes.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddConsumerNodesRequest struct to add consumer nodes diff --git a/pkg/cloudbroker/sep/add_pool.go b/pkg/cloudbroker/sep/add_pool.go index 388ffa7..4b239d0 100644 --- a/pkg/cloudbroker/sep/add_pool.go +++ b/pkg/cloudbroker/sep/add_pool.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddPoolRequest struct to add pool to storage endpoint (SEP) diff --git a/pkg/cloudbroker/sep/add_provider_nodes.go b/pkg/cloudbroker/sep/add_provider_nodes.go index 17829eb..b43668a 100644 --- a/pkg/cloudbroker/sep/add_provider_nodes.go +++ b/pkg/cloudbroker/sep/add_provider_nodes.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AddProviderNodesRequest struct to add provider nodes diff --git a/pkg/cloudbroker/sep/config_field_edit.go b/pkg/cloudbroker/sep/config_field_edit.go index 7021975..28fadc4 100644 --- a/pkg/cloudbroker/sep/config_field_edit.go +++ b/pkg/cloudbroker/sep/config_field_edit.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ConfigFieldEditRequest struct to edit config fields diff --git a/pkg/cloudbroker/sep/config_insert.go b/pkg/cloudbroker/sep/config_insert.go index c146980..4419aa8 100644 --- a/pkg/cloudbroker/sep/config_insert.go +++ b/pkg/cloudbroker/sep/config_insert.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ConfigInsertRequest struct to insert config diff --git a/pkg/cloudbroker/sep/config_validate.go b/pkg/cloudbroker/sep/config_validate.go index 03d3120..60ab364 100644 --- a/pkg/cloudbroker/sep/config_validate.go +++ b/pkg/cloudbroker/sep/config_validate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ConfigValidateRequest struct to validate config diff --git a/pkg/cloudbroker/sep/consumption.go b/pkg/cloudbroker/sep/consumption.go index 416c399..6a6fb64 100644 --- a/pkg/cloudbroker/sep/consumption.go +++ b/pkg/cloudbroker/sep/consumption.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ConsumptionRequest struct to get consumption info diff --git a/pkg/cloudbroker/sep/create.go b/pkg/cloudbroker/sep/create.go index 9892f17..8d46dd2 100644 --- a/pkg/cloudbroker/sep/create.go +++ b/pkg/cloudbroker/sep/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create SEP object diff --git a/pkg/cloudbroker/sep/decommission.go b/pkg/cloudbroker/sep/decommission.go index f0db101..86db6a8 100644 --- a/pkg/cloudbroker/sep/decommission.go +++ b/pkg/cloudbroker/sep/decommission.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DecommissionRequest struct for decommission diff --git a/pkg/cloudbroker/sep/del_consumer_nodes.go b/pkg/cloudbroker/sep/del_consumer_nodes.go index 432237c..08e20ab 100644 --- a/pkg/cloudbroker/sep/del_consumer_nodes.go +++ b/pkg/cloudbroker/sep/del_consumer_nodes.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DelConsumerNodesRequest struct to exclude consumer nodes @@ -17,6 +17,11 @@ type DelConsumerNodesRequest struct { // List of consumer node IDs // Required: true ConsumerNIDs []uint64 `url:"consumer_nids" json:"consumer_nids" validate:"min=1"` + + // The force flag must be set to true only if the node will never come back online + // Default: false + // Required: true + Force bool `url:"force" json:"force" validate:"required"` } // DelConsumerNodes excludes consumer nodes from SEP parameters diff --git a/pkg/cloudbroker/sep/del_pool.go b/pkg/cloudbroker/sep/del_pool.go index 8177b97..4c5b6c8 100644 --- a/pkg/cloudbroker/sep/del_pool.go +++ b/pkg/cloudbroker/sep/del_pool.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DelPoolRequest struct to delete pool from storage endpoint (SEP) diff --git a/pkg/cloudbroker/sep/delete.go b/pkg/cloudbroker/sep/delete.go index 9d6c4eb..0aa7c6b 100644 --- a/pkg/cloudbroker/sep/delete.go +++ b/pkg/cloudbroker/sep/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete SEP diff --git a/pkg/cloudbroker/sep/disable.go b/pkg/cloudbroker/sep/disable.go index bd21ec0..5d97987 100644 --- a/pkg/cloudbroker/sep/disable.go +++ b/pkg/cloudbroker/sep/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable SEP diff --git a/pkg/cloudbroker/sep/disk_list.go b/pkg/cloudbroker/sep/disk_list.go index 6a0bd98..150cb2c 100644 --- a/pkg/cloudbroker/sep/disk_list.go +++ b/pkg/cloudbroker/sep/disk_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DiskListRequest struct to get list of disk IDs diff --git a/pkg/cloudbroker/sep/enable.go b/pkg/cloudbroker/sep/enable.go index 7b9abc6..f363b6b 100644 --- a/pkg/cloudbroker/sep/enable.go +++ b/pkg/cloudbroker/sep/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable SEP diff --git a/pkg/cloudbroker/sep/filter.go b/pkg/cloudbroker/sep/filter.go index d3876fc..54d54c7 100644 --- a/pkg/cloudbroker/sep/filter.go +++ b/pkg/cloudbroker/sep/filter.go @@ -69,3 +69,85 @@ func (lsep ListSEP) FindOne() RecordSEP { return lsep.Data[0] } + +// FilterBySEPID returns ListAvailableSEP with the specified SEPID. +func (sl ListAvailableSEP) FilterBySEPID(sepID uint64) ListAvailableSEP { + predicate := func(sd SEPData) bool { + return sd.SEPID == sepID + } + + return sl.FilterFunc(predicate) +} + +// FilterBySEPName returns ListAvailableSEP with the specified SEPName. +func (sl ListAvailableSEP) FilterBySEPName(SEPName string) ListAvailableSEP { + predicate := func(sd SEPData) bool { + return sd.SEPName == SEPName + } + + return sl.FilterFunc(predicate) +} + +// FilterBySEPType returns ListAvailableSEP with the specified SEPType. +func (sl ListAvailableSEP) FilterBySEPType(SEPType string) ListAvailableSEP { + predicate := func(sd SEPData) bool { + return sd.SEPType == SEPType + } + + return sl.FilterFunc(predicate) +} + +// FilterByPoolType returns ListAvailableSEP where at least one pool has the specified type. +func (sl ListAvailableSEP) FilterByPoolType(poolType string) ListAvailableSEP { + predicate := func(sd SEPData) bool { + for _, pool := range sd.Pools { + for _, pt := range pool.Types { + if pt == poolType { + return true + } + } + } + return false + } + + return sl.FilterFunc(predicate) +} + +// FilterBySystemPool returns ListAvailableSEP where at least one pool is a system pool. +func (sl ListAvailableSEP) FilterBySystemPool(isSystem bool) ListAvailableSEP { + predicate := func(sd SEPData) bool { + for _, pool := range sd.Pools { + if pool.System == isSystem { + return true + } + } + return false + } + + return sl.FilterFunc(predicate) +} + +// FilterFunc allows filtering ListAvailableSEP based on a user-defined predicate. +func (sl ListAvailableSEP) FilterFunc(predicate func(SEPData) bool) ListAvailableSEP { + var result ListAvailableSEP + + for _, item := range sl.Data { + if predicate(item) { + result.Data = append(result.Data, item) + } + } + + result.EntryCount = uint64(len(result.Data)) + + return result +} + +// FindOne returns the first found SEPData. +// If nothing is found, returns an empty struct. +func (sl ListAvailableSEP) FindOne() SEPData { + if len(sl.Data) == 0 { + return SEPData{} + } + + return sl.Data[0] +} diff --git a/pkg/cloudbroker/sep/filter_test.go b/pkg/cloudbroker/sep/filter_test.go index 9ea2bd3..008c92a 100644 --- a/pkg/cloudbroker/sep/filter_test.go +++ b/pkg/cloudbroker/sep/filter_test.go @@ -5,13 +5,7 @@ import "testing" var seps = ListSEP{ Data: []RecordSEP{ { - CKey: "", - Meta: []interface{}{ - "osismodel", - "cloudbroker", - "sep", - 1, - }, + Config: map[string]interface{}{ "API_IPs": []string{ "10.212.3.61", @@ -39,13 +33,7 @@ var seps = ListSEP{ Type: "DES", }, { - CKey: "", - Meta: []interface{}{ - "osismodel", - "cloudbroker", - "sep", - 1, - }, + Config: map[string]interface{}{ "API_IPs": []string{ "10.212.3.64", @@ -74,13 +62,7 @@ var seps = ListSEP{ Type: "DES", }, { - CKey: "", - Meta: []interface{}{ - "osismodel", - "cloudbroker", - "sep", - 1, - }, + Config: map[string]interface{}{ "API_IPs": []string{ "10.212.3.67", @@ -185,3 +167,116 @@ func TestFilterFunc(t *testing.T) { } } } + +var availableSeps = ListAvailableSEP{ + EntryCount: 3, + Data: []SEPData{ + { + SEPID: 1, + SEPName: "sep_1", + SEPType: "TATLIN", + Pools: []Pool{ + { + Name: "pool_1", + Types: []string{"DES"}, + System: false, + }, + }, + }, + { + SEPID: 2, + SEPName: "sep_2", + SEPType: "SHARED", + Pools: []Pool{ + { + Name: "pool_2", + Types: []string{"DES"}, + System: true, + }, + }, + }, + { + SEPID: 3, + SEPName: "sep_3", + SEPType: "DES", + Pools: []Pool{ + { + Name: "pool_3", + Types: []string{"DES"}, + System: false, + }, + }, + }, + }, +} + +func TestFilterBySEPID(t *testing.T) { + actual := availableSeps.FilterBySEPID(1).FindOne() + + if actual.SEPID != 1 { + t.Fatal("expected SEPID 1, found: ", actual.SEPID) + } +} + +func TestFilterBySEPName(t *testing.T) { + actual := availableSeps.FilterBySEPName("sep_2").FindOne() + + if actual.SEPName != "sep_2" { + t.Fatal("expected SEPName 'sep_2', found: ", actual.SEPName) + } +} + +func TestFilterBySEPType(t *testing.T) { + actual := availableSeps.FilterBySEPType("TATLIN").FindOne() + + if actual.SEPType != "TATLIN" { + t.Fatal("expected SEPType 'TATLIN', found: ", actual.SEPType) + } +} + +func TestFilterByPoolType(t *testing.T) { + actual := availableSeps.FilterByPoolType("DES") + + if len(actual.Data) != 3 { + t.Fatal("expected 3 found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + found := false + for _, pool := range item.Pools { + for _, poolType := range pool.Types { + if poolType == "DES" { + found = true + break + } + } + if found { + break + } + } + if !found { + t.Fatal("expected Pool type 'DES', not found in SEP: ", item.SEPID) + } + } +} + +func TestFilterBySystemPool(t *testing.T) { + actual := availableSeps.FilterBySystemPool(true) + + if len(actual.Data) != 1 { + t.Fatal("expected 1 found, actual: ", len(actual.Data)) + } + + for _, item := range actual.Data { + found := false + for _, pool := range item.Pools { + if pool.System { + found = true + break + } + } + if !found { + t.Fatal("expected System pool, not found in SEP: ", item.SEPID) + } + } +} diff --git a/pkg/cloudbroker/sep/get.go b/pkg/cloudbroker/sep/get.go index d86bfba..1dd0cc7 100644 --- a/pkg/cloudbroker/sep/get.go +++ b/pkg/cloudbroker/sep/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get SEP parameters diff --git a/pkg/cloudbroker/sep/get_config.go b/pkg/cloudbroker/sep/get_config.go index 4e6216d..60a0500 100644 --- a/pkg/cloudbroker/sep/get_config.go +++ b/pkg/cloudbroker/sep/get_config.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetConfigRequest struct to get SEP config diff --git a/pkg/cloudbroker/sep/get_pool.go b/pkg/cloudbroker/sep/get_pool.go index 2441438..6dd0b8d 100644 --- a/pkg/cloudbroker/sep/get_pool.go +++ b/pkg/cloudbroker/sep/get_pool.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetPoolRequest struct to get SEP pool config by name diff --git a/pkg/cloudbroker/sep/get_template.go b/pkg/cloudbroker/sep/get_template.go new file mode 100644 index 0000000..0571df9 --- /dev/null +++ b/pkg/cloudbroker/sep/get_template.go @@ -0,0 +1,36 @@ +package sep + +import ( + "context" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// GetTemplateRequest struct to get template of SEP +type GetTemplateRequest struct { + // Type of SEP + // Required: true + SepType string `url:"sep_type" json:"sep_type" validate:"required,sepType"` + + // Language of template + // Required: true + Language string `url:"lang" json:"lang" validate:"required,language"` +} + +// GetTemplate gets data to sep template +func (s SEP) GetTemplate(ctx context.Context, req GetTemplateRequest) (string, error) { + err := validators.ValidateRequest(req) + if err != nil { + return "", validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/sep/getTemplate" + + res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req) + if err != nil { + return "", err + } + + return string(res), nil +} diff --git a/pkg/cloudbroker/sep/list.go b/pkg/cloudbroker/sep/list.go index a43c585..ad0da82 100644 --- a/pkg/cloudbroker/sep/list.go +++ b/pkg/cloudbroker/sep/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of SEPs diff --git a/pkg/cloudbroker/sep/list_available_sep_and_pools.go b/pkg/cloudbroker/sep/list_available_sep_and_pools.go new file mode 100644 index 0000000..68b6823 --- /dev/null +++ b/pkg/cloudbroker/sep/list_available_sep_and_pools.go @@ -0,0 +1,51 @@ +package sep + +import ( + "context" + "encoding/json" + "net/http" + + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" +) + +// ListAvailableSEPAndPoolsRequest struct to get dict with entry count and list of dict with SEPs and pools details accessible by the Account and RG +type ListAvailableSEPAndPoolsRequest struct { + // Account ID + // Required: true + AccountID uint64 `url:"account_id" json:"account_id" validate:"required"` + + // RG ID + // Required: false + RGID uint64 `url:"rg_id,omitempty" json:"rg_id,omitempty"` +} + +// ListAvailableSEPAndPools get dict with entry count and list of dict with SEPs and pools details accessible by the Account and RG +func (s SEP) ListAvailableSEPAndPools(ctx context.Context, req ListAvailableSEPAndPoolsRequest) (*ListAvailableSEP, error) { + res, err := s.ListAvailableSEPAndPoolsRaw(ctx, req) + if err != nil { + return nil, err + } + + list := ListAvailableSEP{} + + err = json.Unmarshal(res, &list) + if err != nil { + return nil, err + } + + return &list, nil +} + +// ListRaw gets list as an array of bytes +func (s SEP) ListAvailableSEPAndPoolsRaw(ctx context.Context, req ListAvailableSEPAndPoolsRequest) ([]byte, error) { + + err := validators.ValidateRequest(req) + if err != nil { + return nil, validators.ValidationErrors(validators.GetErrors(err)) + } + + url := "/cloudbroker/sep/listAvailableSepAndPools" + + res, err := s.client.DecortApiCall(ctx, http.MethodPost, url, req) + return res, err +} diff --git a/pkg/cloudbroker/sep/models.go b/pkg/cloudbroker/sep/models.go index f22c31a..401b151 100644 --- a/pkg/cloudbroker/sep/models.go +++ b/pkg/cloudbroker/sep/models.go @@ -152,3 +152,36 @@ type ListSEP struct { // Entry count EntryCount uint64 `json:"entryCount"` } + +type Pool struct { + // Pool name + Name string `json:"name"` + + // Pool types + Types []string `json:"types"` + + // System + System bool `json:"system"` +} + +type SEPData struct { + // SEP ID + SEPID uint64 `json:"sepId"` + + // SEP name + SEPName string `json:"sepName"` + + // Sep type + SEPType string `json:"sepType"` + + // Pools + Pools []Pool `json:"pools"` +} + +type ListAvailableSEP struct { + // Entry count + EntryCount uint64 `json:"entryCount"` + + // Data + Data []SEPData `json:"data"` +} diff --git a/pkg/cloudbroker/sep/sep.go b/pkg/cloudbroker/sep/sep.go index 8b9e965..26fb750 100644 --- a/pkg/cloudbroker/sep/sep.go +++ b/pkg/cloudbroker/sep/sep.go @@ -2,7 +2,7 @@ package sep import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to storage endpoint provider diff --git a/pkg/cloudbroker/sep/serialize.go b/pkg/cloudbroker/sep/serialize.go index 00cdd58..306ccb6 100644 --- a/pkg/cloudbroker/sep/serialize.go +++ b/pkg/cloudbroker/sep/serialize.go @@ -3,7 +3,7 @@ package sep import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. @@ -41,3 +41,39 @@ func (rsep RecordSEP) Serialize(params ...string) (serialization.Serialized, err return json.Marshal(rsep) } + +// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. +// +// In order to serialize with indent make sure to follow these guidelines: +// - First argument -> prefix +// - Second argument -> indent +func (lsep ListAvailableSEP) Serialize(params ...string) (serialization.Serialized, error) { + if len(lsep.Data) == 0 { + return []byte{}, nil + } + + if len(params) > 1 { + prefix := params[0] + indent := params[1] + + return json.MarshalIndent(lsep, prefix, indent) + } + + return json.Marshal(lsep) +} + +// Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. +// +// In order to serialize with indent make sure to follow these guidelines: +// - First argument -> prefix +// - Second argument -> indent +func (rsep SEPData) Serialize(params ...string) (serialization.Serialized, error) { + if len(params) > 1 { + prefix := params[0] + indent := params[1] + + return json.MarshalIndent(rsep, prefix, indent) + } + + return json.Marshal(rsep) +} diff --git a/pkg/cloudbroker/sep/shared_lock_start.go b/pkg/cloudbroker/sep/shared_lock_start.go index ba53e62..ae8b11f 100644 --- a/pkg/cloudbroker/sep/shared_lock_start.go +++ b/pkg/cloudbroker/sep/shared_lock_start.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SharedLockStartRequest struct to start shared locks diff --git a/pkg/cloudbroker/sep/shared_lock_stop.go b/pkg/cloudbroker/sep/shared_lock_stop.go index 0820548..a7ef01e 100644 --- a/pkg/cloudbroker/sep/shared_lock_stop.go +++ b/pkg/cloudbroker/sep/shared_lock_stop.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SharedLockStopRequest struct to stop shared locks diff --git a/pkg/cloudbroker/stack.go b/pkg/cloudbroker/stack.go index 61da99d..a48ccea 100644 --- a/pkg/cloudbroker/stack.go +++ b/pkg/cloudbroker/stack.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/stack" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/stack" ) // Accessing the Stack method group diff --git a/pkg/cloudbroker/stack/get.go b/pkg/cloudbroker/stack/get.go index 75f6896..2d16232 100644 --- a/pkg/cloudbroker/stack/get.go +++ b/pkg/cloudbroker/stack/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get list of stacks diff --git a/pkg/cloudbroker/stack/get_logical_cores_count.go b/pkg/cloudbroker/stack/get_logical_cores_count.go index 1be0c82..12efdbd 100644 --- a/pkg/cloudbroker/stack/get_logical_cores_count.go +++ b/pkg/cloudbroker/stack/get_logical_cores_count.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetLogicalCoresCountRequest struct to get logical cores count by stack diff --git a/pkg/cloudbroker/stack/list.go b/pkg/cloudbroker/stack/list.go index 2363a33..932f2a6 100644 --- a/pkg/cloudbroker/stack/list.go +++ b/pkg/cloudbroker/stack/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of stacks diff --git a/pkg/cloudbroker/stack/models.go b/pkg/cloudbroker/stack/models.go index 3613ea1..d79decf 100644 --- a/pkg/cloudbroker/stack/models.go +++ b/pkg/cloudbroker/stack/models.go @@ -43,7 +43,7 @@ type InfoStack struct { // ID ID uint64 `json:"id"` - + // List image IDs Images []uint64 `json:"images"` @@ -83,6 +83,9 @@ type ListStacks struct { // Package type Packages struct { + // LibGuestFSTools + LibGuestFSTools LibGuestFSTools `json:"libguestfs-tools"` + // LibvirtBin LibvirtBin LibvirtBin `json:"libvirt-bin"` @@ -105,6 +108,15 @@ type Packages struct { Sanlock Sanlock `json:"sanlock"` } +// LibGuestFSTools +type LibGuestFSTools struct { + // InstalledSize + InstalledSize string `json:"installed_size"` + + // Version + Ver string `json:"ver"` +} + // LibvirtBin type LibvirtBin struct { // InstalledSize diff --git a/pkg/cloudbroker/stack/set_cpu_allocation_ratio.go b/pkg/cloudbroker/stack/set_cpu_allocation_ratio.go index 172d89b..337bc7f 100644 --- a/pkg/cloudbroker/stack/set_cpu_allocation_ratio.go +++ b/pkg/cloudbroker/stack/set_cpu_allocation_ratio.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetCpuAllocationRatioRequest struct to set CPU allocation ratio diff --git a/pkg/cloudbroker/stack/set_mem_allocation_ratio.go b/pkg/cloudbroker/stack/set_mem_allocation_ratio.go index 4b9ea95..cec3605 100644 --- a/pkg/cloudbroker/stack/set_mem_allocation_ratio.go +++ b/pkg/cloudbroker/stack/set_mem_allocation_ratio.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // SetMemAllocationRatioRequest struct to set memory allocation ratio diff --git a/pkg/cloudbroker/stack/stack.go b/pkg/cloudbroker/stack/stack.go index 383b55c..bae6f29 100644 --- a/pkg/cloudbroker/stack/stack.go +++ b/pkg/cloudbroker/stack/stack.go @@ -1,6 +1,6 @@ package stack -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to stack type Stack struct { diff --git a/pkg/cloudbroker/tasks.go b/pkg/cloudbroker/tasks.go index 94ee2d0..09f5bfc 100644 --- a/pkg/cloudbroker/tasks.go +++ b/pkg/cloudbroker/tasks.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/tasks" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/tasks" ) // Accessing the tasks method group diff --git a/pkg/cloudbroker/tasks/get.go b/pkg/cloudbroker/tasks/get.go index 6c41b06..b026188 100644 --- a/pkg/cloudbroker/tasks/get.go +++ b/pkg/cloudbroker/tasks/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get background API task status and result diff --git a/pkg/cloudbroker/tasks/list.go b/pkg/cloudbroker/tasks/list.go index 419a299..6a805f1 100644 --- a/pkg/cloudbroker/tasks/list.go +++ b/pkg/cloudbroker/tasks/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of audits diff --git a/pkg/cloudbroker/tasks/tasks.go b/pkg/cloudbroker/tasks/tasks.go index c7e07ff..6fffad2 100644 --- a/pkg/cloudbroker/tasks/tasks.go +++ b/pkg/cloudbroker/tasks/tasks.go @@ -1,7 +1,7 @@ // User API tasks interface package tasks -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to tasks type Tasks struct { diff --git a/pkg/cloudbroker/user.go b/pkg/cloudbroker/user.go index 9c7f693..d27cf3b 100644 --- a/pkg/cloudbroker/user.go +++ b/pkg/cloudbroker/user.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/user" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/user" func (cb *CloudBroker) User() *user.User { return user.New(cb.client) diff --git a/pkg/cloudbroker/user/api_list.go b/pkg/cloudbroker/user/api_list.go index afc6db1..ebdc062 100644 --- a/pkg/cloudbroker/user/api_list.go +++ b/pkg/cloudbroker/user/api_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // APIListRequest struct for getting API list. diff --git a/pkg/cloudbroker/user/apiaccess_join.go b/pkg/cloudbroker/user/apiaccess_join.go index 905f694..4895ef6 100644 --- a/pkg/cloudbroker/user/apiaccess_join.go +++ b/pkg/cloudbroker/user/apiaccess_join.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // APIAccessJoinRequest struct for joining user into apiaccess group. diff --git a/pkg/cloudbroker/user/apiaccess_leave.go b/pkg/cloudbroker/user/apiaccess_leave.go index 97e07be..2943f7c 100644 --- a/pkg/cloudbroker/user/apiaccess_leave.go +++ b/pkg/cloudbroker/user/apiaccess_leave.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // APIAccessLeaveRequest struct for leaving user from apiaccess group. diff --git a/pkg/cloudbroker/user/apiaccess_list.go b/pkg/cloudbroker/user/apiaccess_list.go index 5737be2..74a7f0d 100644 --- a/pkg/cloudbroker/user/apiaccess_list.go +++ b/pkg/cloudbroker/user/apiaccess_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // APIAccessListRequest struct for showing list of dicts with information about diff --git a/pkg/cloudbroker/user/create.go b/pkg/cloudbroker/user/create.go index 2cf9e17..9df3789 100644 --- a/pkg/cloudbroker/user/create.go +++ b/pkg/cloudbroker/user/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct for creating a user. diff --git a/pkg/cloudbroker/user/delete.go b/pkg/cloudbroker/user/delete.go index 1dd2be8..f9901be 100644 --- a/pkg/cloudbroker/user/delete.go +++ b/pkg/cloudbroker/user/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct for deleting a user. diff --git a/pkg/cloudbroker/user/delete_by_guid.go b/pkg/cloudbroker/user/delete_by_guid.go index 47b7261..b2aa3d8 100644 --- a/pkg/cloudbroker/user/delete_by_guid.go +++ b/pkg/cloudbroker/user/delete_by_guid.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteByGUIDRequest struct for deleting a user using user's GUID. diff --git a/pkg/cloudbroker/user/delete_users.go b/pkg/cloudbroker/user/delete_users.go index 20825f1..eb48a96 100644 --- a/pkg/cloudbroker/user/delete_users.go +++ b/pkg/cloudbroker/user/delete_users.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteUsersRequest struct for bulk delete a list of users. diff --git a/pkg/cloudbroker/user/get.go b/pkg/cloudbroker/user/get.go index 17faf58..c650a4c 100644 --- a/pkg/cloudbroker/user/get.go +++ b/pkg/cloudbroker/user/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get user details. diff --git a/pkg/cloudbroker/user/get_matching_usernames.go b/pkg/cloudbroker/user/get_matching_usernames.go index fb3a8c4..b73f8a6 100644 --- a/pkg/cloudbroker/user/get_matching_usernames.go +++ b/pkg/cloudbroker/user/get_matching_usernames.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetMatchingUsernamesRequest struct for getting a list of the matching usernames for a given string. diff --git a/pkg/cloudbroker/user/list.go b/pkg/cloudbroker/user/list.go index 5816fbf..d5a80e2 100644 --- a/pkg/cloudbroker/user/list.go +++ b/pkg/cloudbroker/user/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get all non deleted user instances. diff --git a/pkg/cloudbroker/user/user.go b/pkg/cloudbroker/user/user.go index 2fe152a..cd5cfb7 100644 --- a/pkg/cloudbroker/user/user.go +++ b/pkg/cloudbroker/user/user.go @@ -1,6 +1,6 @@ package user -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to User type User struct { diff --git a/pkg/cloudbroker/vfpool.go b/pkg/cloudbroker/vfpool.go index 2358287..e17f286 100644 --- a/pkg/cloudbroker/vfpool.go +++ b/pkg/cloudbroker/vfpool.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/vfpool" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/vfpool" // Accessing the VFPool method group func (cb *CloudBroker) VFPool() *vfpool.VFPool { diff --git a/pkg/cloudbroker/vfpool/create.go b/pkg/cloudbroker/vfpool/create.go index a9fd075..a603145 100644 --- a/pkg/cloudbroker/vfpool/create.go +++ b/pkg/cloudbroker/vfpool/create.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct to create vfpool device diff --git a/pkg/cloudbroker/vfpool/delete.go b/pkg/cloudbroker/vfpool/delete.go index 2c8b80f..5b7232f 100644 --- a/pkg/cloudbroker/vfpool/delete.go +++ b/pkg/cloudbroker/vfpool/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete vfpool device diff --git a/pkg/cloudbroker/vfpool/disable.go b/pkg/cloudbroker/vfpool/disable.go index b403a63..096b00c 100644 --- a/pkg/cloudbroker/vfpool/disable.go +++ b/pkg/cloudbroker/vfpool/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable vfpool device diff --git a/pkg/cloudbroker/vfpool/enable.go b/pkg/cloudbroker/vfpool/enable.go index f9c7819..0358359 100644 --- a/pkg/cloudbroker/vfpool/enable.go +++ b/pkg/cloudbroker/vfpool/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable vfpool device diff --git a/pkg/cloudbroker/vfpool/get.go b/pkg/cloudbroker/vfpool/get.go index b869d2b..1719db6 100644 --- a/pkg/cloudbroker/vfpool/get.go +++ b/pkg/cloudbroker/vfpool/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get detailed information about vfpool device diff --git a/pkg/cloudbroker/vfpool/list.go b/pkg/cloudbroker/vfpool/list.go index 7268a08..f4a9e39 100644 --- a/pkg/cloudbroker/vfpool/list.go +++ b/pkg/cloudbroker/vfpool/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of vfpool devices diff --git a/pkg/cloudbroker/vfpool/serialize.go b/pkg/cloudbroker/vfpool/serialize.go index c40fc44..a0347d1 100644 --- a/pkg/cloudbroker/vfpool/serialize.go +++ b/pkg/cloudbroker/vfpool/serialize.go @@ -3,7 +3,7 @@ package vfpool import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/vfpool/update.go b/pkg/cloudbroker/vfpool/update.go index f02bd42..ce5aa68 100644 --- a/pkg/cloudbroker/vfpool/update.go +++ b/pkg/cloudbroker/vfpool/update.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // UpdateRequest struct to update vfpool device diff --git a/pkg/cloudbroker/vfpool/vfpool.go b/pkg/cloudbroker/vfpool/vfpool.go index f952dee..d8ca096 100644 --- a/pkg/cloudbroker/vfpool/vfpool.go +++ b/pkg/cloudbroker/vfpool/vfpool.go @@ -2,7 +2,7 @@ package vfpool import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to vfpool diff --git a/pkg/cloudbroker/vgpu.go b/pkg/cloudbroker/vgpu.go index 80f3604..cf4e720 100644 --- a/pkg/cloudbroker/vgpu.go +++ b/pkg/cloudbroker/vgpu.go @@ -1,6 +1,6 @@ package cloudbroker -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/vgpu" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/vgpu" // Accessing the VGPU method group func (cb *CloudBroker) VGPU() *vgpu.VGPU { diff --git a/pkg/cloudbroker/vgpu/allocate.go b/pkg/cloudbroker/vgpu/allocate.go index ce6ac40..253128f 100644 --- a/pkg/cloudbroker/vgpu/allocate.go +++ b/pkg/cloudbroker/vgpu/allocate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AllocateRequest struct for allocating VGPU diff --git a/pkg/cloudbroker/vgpu/create.go b/pkg/cloudbroker/vgpu/create.go index 9f085d9..de426d7 100644 --- a/pkg/cloudbroker/vgpu/create.go +++ b/pkg/cloudbroker/vgpu/create.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateRequest struct for creating VGPU diff --git a/pkg/cloudbroker/vgpu/deallocate.go b/pkg/cloudbroker/vgpu/deallocate.go index e2b6b1e..72eb392 100644 --- a/pkg/cloudbroker/vgpu/deallocate.go +++ b/pkg/cloudbroker/vgpu/deallocate.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeallocateRequest struct for deallocating VGPU diff --git a/pkg/cloudbroker/vgpu/destroy.go b/pkg/cloudbroker/vgpu/destroy.go index a600723..1d90a5d 100644 --- a/pkg/cloudbroker/vgpu/destroy.go +++ b/pkg/cloudbroker/vgpu/destroy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DestroyRequest struct for destroying VGPU diff --git a/pkg/cloudbroker/vgpu/list.go b/pkg/cloudbroker/vgpu/list.go index 6a53f57..9711654 100644 --- a/pkg/cloudbroker/vgpu/list.go +++ b/pkg/cloudbroker/vgpu/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of VGPU diff --git a/pkg/cloudbroker/vgpu/serialize.go b/pkg/cloudbroker/vgpu/serialize.go index b25a89e..548a3be 100644 --- a/pkg/cloudbroker/vgpu/serialize.go +++ b/pkg/cloudbroker/vgpu/serialize.go @@ -3,7 +3,7 @@ package vgpu import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/vgpu/vgpu.go b/pkg/cloudbroker/vgpu/vgpu.go index 2e0efc3..3b0b22b 100644 --- a/pkg/cloudbroker/vgpu/vgpu.go +++ b/pkg/cloudbroker/vgpu/vgpu.go @@ -1,6 +1,6 @@ package vgpu -import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" +import "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" // Structure for creating request to VGPU type VGPU struct { diff --git a/pkg/cloudbroker/vins.go b/pkg/cloudbroker/vins.go index 85360ee..aace822 100644 --- a/pkg/cloudbroker/vins.go +++ b/pkg/cloudbroker/vins.go @@ -1,7 +1,7 @@ package cloudbroker import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker/vins" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker/vins" ) // Accessing the VINS method group diff --git a/pkg/cloudbroker/vins/audits.go b/pkg/cloudbroker/vins/audits.go index 270b2e8..0407b94 100644 --- a/pkg/cloudbroker/vins/audits.go +++ b/pkg/cloudbroker/vins/audits.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // AuditsRequest struct to get audits diff --git a/pkg/cloudbroker/vins/create_in_account.go b/pkg/cloudbroker/vins/create_in_account.go index 32abe3b..1da56b4 100644 --- a/pkg/cloudbroker/vins/create_in_account.go +++ b/pkg/cloudbroker/vins/create_in_account.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) type Route struct { diff --git a/pkg/cloudbroker/vins/create_in_rg.go b/pkg/cloudbroker/vins/create_in_rg.go index d190999..0d40020 100644 --- a/pkg/cloudbroker/vins/create_in_rg.go +++ b/pkg/cloudbroker/vins/create_in_rg.go @@ -6,7 +6,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // CreateInRGRequest struct to create VINS in resource group diff --git a/pkg/cloudbroker/vins/default_qos_update.go b/pkg/cloudbroker/vins/default_qos_update.go index 9c8fdd2..62fff22 100644 --- a/pkg/cloudbroker/vins/default_qos_update.go +++ b/pkg/cloudbroker/vins/default_qos_update.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DefaultQOSUpdateRequest struct to update QOS diff --git a/pkg/cloudbroker/vins/delete.go b/pkg/cloudbroker/vins/delete.go index 01f034e..5c6bc40 100644 --- a/pkg/cloudbroker/vins/delete.go +++ b/pkg/cloudbroker/vins/delete.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DeleteRequest struct to delete VINS diff --git a/pkg/cloudbroker/vins/disable.go b/pkg/cloudbroker/vins/disable.go index 4d00487..f07a740 100644 --- a/pkg/cloudbroker/vins/disable.go +++ b/pkg/cloudbroker/vins/disable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DisableRequest struct to disable VINS diff --git a/pkg/cloudbroker/vins/dns_apply.go b/pkg/cloudbroker/vins/dns_apply.go index 6da9c30..f9dbceb 100644 --- a/pkg/cloudbroker/vins/dns_apply.go +++ b/pkg/cloudbroker/vins/dns_apply.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // DNSApplyRequest struct to apply new DNS list in VINS diff --git a/pkg/cloudbroker/vins/enable.go b/pkg/cloudbroker/vins/enable.go index 9ca8c33..55e9495 100644 --- a/pkg/cloudbroker/vins/enable.go +++ b/pkg/cloudbroker/vins/enable.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // EnableRequest struct to enable VINS diff --git a/pkg/cloudbroker/vins/extnet_connect.go b/pkg/cloudbroker/vins/extnet_connect.go index a7a0759..52ec98f 100644 --- a/pkg/cloudbroker/vins/extnet_connect.go +++ b/pkg/cloudbroker/vins/extnet_connect.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ExtNetConnectRequest struct to connect external network diff --git a/pkg/cloudbroker/vins/extnet_disconnect.go b/pkg/cloudbroker/vins/extnet_disconnect.go index 98c1bef..1fe1989 100644 --- a/pkg/cloudbroker/vins/extnet_disconnect.go +++ b/pkg/cloudbroker/vins/extnet_disconnect.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ExtNetDisconnectRequest struct to disconnect VINS from external network diff --git a/pkg/cloudbroker/vins/extnet_list.go b/pkg/cloudbroker/vins/extnet_list.go index 509ed31..57d81a0 100644 --- a/pkg/cloudbroker/vins/extnet_list.go +++ b/pkg/cloudbroker/vins/extnet_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ExtNetListRequest struct to get list of VINS external network connections diff --git a/pkg/cloudbroker/vins/get.go b/pkg/cloudbroker/vins/get.go index beee627..5182cd5 100644 --- a/pkg/cloudbroker/vins/get.go +++ b/pkg/cloudbroker/vins/get.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // GetRequest struct to get information about VINS diff --git a/pkg/cloudbroker/vins/ip_list.go b/pkg/cloudbroker/vins/ip_list.go index b2f234c..1bcbe4b 100644 --- a/pkg/cloudbroker/vins/ip_list.go +++ b/pkg/cloudbroker/vins/ip_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPListRequest struct for DHCP IP diff --git a/pkg/cloudbroker/vins/ip_release.go b/pkg/cloudbroker/vins/ip_release.go index 141531b..2b76b4d 100644 --- a/pkg/cloudbroker/vins/ip_release.go +++ b/pkg/cloudbroker/vins/ip_release.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPReleaseRequest struct for IP release diff --git a/pkg/cloudbroker/vins/ip_reserve.go b/pkg/cloudbroker/vins/ip_reserve.go index 0445f28..ac23277 100644 --- a/pkg/cloudbroker/vins/ip_reserve.go +++ b/pkg/cloudbroker/vins/ip_reserve.go @@ -5,7 +5,7 @@ import ( "net/http" "strings" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // IPReserveRequest struct for IP reserve diff --git a/pkg/cloudbroker/vins/list.go b/pkg/cloudbroker/vins/list.go index 7753c79..42497af 100644 --- a/pkg/cloudbroker/vins/list.go +++ b/pkg/cloudbroker/vins/list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListRequest struct to get list of VINSes @@ -18,6 +18,10 @@ type ListRequest struct { // Required: false Name string `url:"name,omitempty" json:"name,omitempty"` + // Find by status + // Required: false + Status string `url:"status,omitempty" json:"status,omitempty"` + // Find by account ID // Required: false AccountID uint64 `url:"accountId,omitempty" json:"accountId,omitempty"` diff --git a/pkg/cloudbroker/vins/list_deleted.go b/pkg/cloudbroker/vins/list_deleted.go index 506627e..6e50d1b 100644 --- a/pkg/cloudbroker/vins/list_deleted.go +++ b/pkg/cloudbroker/vins/list_deleted.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // ListDeletedRequest struct to get list of deleted VINSes diff --git a/pkg/cloudbroker/vins/mass_delete.go b/pkg/cloudbroker/vins/mass_delete.go index 9c3dab2..ccc60b4 100644 --- a/pkg/cloudbroker/vins/mass_delete.go +++ b/pkg/cloudbroker/vins/mass_delete.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassDeleteRequest struct to delete several VINSes diff --git a/pkg/cloudbroker/vins/mass_disable.go b/pkg/cloudbroker/vins/mass_disable.go index e8f649f..846c00f 100644 --- a/pkg/cloudbroker/vins/mass_disable.go +++ b/pkg/cloudbroker/vins/mass_disable.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassDisableRequest struct to disable several VINSes diff --git a/pkg/cloudbroker/vins/mass_enable.go b/pkg/cloudbroker/vins/mass_enable.go index 6608f95..e71c208 100644 --- a/pkg/cloudbroker/vins/mass_enable.go +++ b/pkg/cloudbroker/vins/mass_enable.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // MassEnableRequest struct to enable several VINSes diff --git a/pkg/cloudbroker/vins/nat_rule_add.go b/pkg/cloudbroker/vins/nat_rule_add.go index d1fe24f..cba8a5b 100644 --- a/pkg/cloudbroker/vins/nat_rule_add.go +++ b/pkg/cloudbroker/vins/nat_rule_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NATRuleAddRequest struct to create NAT rules diff --git a/pkg/cloudbroker/vins/nat_rule_del.go b/pkg/cloudbroker/vins/nat_rule_del.go index 642c476..3fd9760 100644 --- a/pkg/cloudbroker/vins/nat_rule_del.go +++ b/pkg/cloudbroker/vins/nat_rule_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NATRuleDelRequest struct to delete NAT rule diff --git a/pkg/cloudbroker/vins/nat_rule_list.go b/pkg/cloudbroker/vins/nat_rule_list.go index d5fef69..f760a4e 100644 --- a/pkg/cloudbroker/vins/nat_rule_list.go +++ b/pkg/cloudbroker/vins/nat_rule_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NATRuleListRequest struct to get list of NAT rules diff --git a/pkg/cloudbroker/vins/net_qos.go b/pkg/cloudbroker/vins/net_qos.go index 8314ce9..f73a4af 100644 --- a/pkg/cloudbroker/vins/net_qos.go +++ b/pkg/cloudbroker/vins/net_qos.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // NetQOSRequest struct to update all VINS interfaces QOS diff --git a/pkg/cloudbroker/vins/restore.go b/pkg/cloudbroker/vins/restore.go index 5769957..e93b397 100644 --- a/pkg/cloudbroker/vins/restore.go +++ b/pkg/cloudbroker/vins/restore.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // RestoreRequest struct for restore diff --git a/pkg/cloudbroker/vins/serialize.go b/pkg/cloudbroker/vins/serialize.go index 0817930..472cd51 100644 --- a/pkg/cloudbroker/vins/serialize.go +++ b/pkg/cloudbroker/vins/serialize.go @@ -3,7 +3,7 @@ package vins import ( "encoding/json" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/serialization" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/serialization" ) // Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions. diff --git a/pkg/cloudbroker/vins/static_route_access_grant.go b/pkg/cloudbroker/vins/static_route_access_grant.go index 4b24968..3c4f68f 100644 --- a/pkg/cloudbroker/vins/static_route_access_grant.go +++ b/pkg/cloudbroker/vins/static_route_access_grant.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAccessGrantRequest struct to grant access to static route to Compute/ViNS diff --git a/pkg/cloudbroker/vins/static_route_access_revoke.go b/pkg/cloudbroker/vins/static_route_access_revoke.go index d1bdba6..e770ec3 100644 --- a/pkg/cloudbroker/vins/static_route_access_revoke.go +++ b/pkg/cloudbroker/vins/static_route_access_revoke.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAccessRevokeRequest struct to revoke access to static route to Compute/ViNS diff --git a/pkg/cloudbroker/vins/static_route_add.go b/pkg/cloudbroker/vins/static_route_add.go index 30dfd64..a9e89ac 100644 --- a/pkg/cloudbroker/vins/static_route_add.go +++ b/pkg/cloudbroker/vins/static_route_add.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteAddRequest struct to add static route diff --git a/pkg/cloudbroker/vins/static_route_del.go b/pkg/cloudbroker/vins/static_route_del.go index 18acf5f..768b98b 100644 --- a/pkg/cloudbroker/vins/static_route_del.go +++ b/pkg/cloudbroker/vins/static_route_del.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteDelRequest struct to remove static route from ViNS diff --git a/pkg/cloudbroker/vins/static_route_list.go b/pkg/cloudbroker/vins/static_route_list.go index be12298..d42ef8c 100644 --- a/pkg/cloudbroker/vins/static_route_list.go +++ b/pkg/cloudbroker/vins/static_route_list.go @@ -5,7 +5,7 @@ import ( "encoding/json" "net/http" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // StaticRouteListRequest struct for static route list diff --git a/pkg/cloudbroker/vins/vins.go b/pkg/cloudbroker/vins/vins.go index 33902ae..ca7c77d 100644 --- a/pkg/cloudbroker/vins/vins.go +++ b/pkg/cloudbroker/vins/vins.go @@ -2,7 +2,7 @@ package vins import ( - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/interfaces" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/interfaces" ) // Structure for creating request to VINS diff --git a/pkg/cloudbroker/vins/vnfdev_redeploy.go b/pkg/cloudbroker/vins/vnfdev_redeploy.go index d184410..e6e3d4f 100644 --- a/pkg/cloudbroker/vins/vnfdev_redeploy.go +++ b/pkg/cloudbroker/vins/vnfdev_redeploy.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // VNFDevRedeployRequest struct to redeploy VNF devices diff --git a/pkg/cloudbroker/vins/vnfdev_reset.go b/pkg/cloudbroker/vins/vnfdev_reset.go index cb13cc0..26e334e 100644 --- a/pkg/cloudbroker/vins/vnfdev_reset.go +++ b/pkg/cloudbroker/vins/vnfdev_reset.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // VNFDevResetRequest struct to reset VNF device diff --git a/pkg/cloudbroker/vins/vnfdev_restart.go b/pkg/cloudbroker/vins/vnfdev_restart.go index a376e9a..a7b386d 100644 --- a/pkg/cloudbroker/vins/vnfdev_restart.go +++ b/pkg/cloudbroker/vins/vnfdev_restart.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // VNFDevRestartRequest struct to reboot VINSes primary VNF device diff --git a/pkg/cloudbroker/vins/vnfdev_start.go b/pkg/cloudbroker/vins/vnfdev_start.go index afd453b..9c079c5 100644 --- a/pkg/cloudbroker/vins/vnfdev_start.go +++ b/pkg/cloudbroker/vins/vnfdev_start.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // VNFDevStartRequest struct to start VNF devices diff --git a/pkg/cloudbroker/vins/vnfdev_stop.go b/pkg/cloudbroker/vins/vnfdev_stop.go index ab7af09..c7baa3b 100644 --- a/pkg/cloudbroker/vins/vnfdev_stop.go +++ b/pkg/cloudbroker/vins/vnfdev_stop.go @@ -5,7 +5,7 @@ import ( "net/http" "strconv" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/internal/validators" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/internal/validators" ) // VNFDevStopRequest struct to stop VNF devices diff --git a/universal-client.go b/universal-client.go index 9384e89..7832ae6 100644 --- a/universal-client.go +++ b/universal-client.go @@ -4,9 +4,9 @@ import ( "fmt" "reflect" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/config" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudapi" - "repository.basistech.ru/BASIS/dynamix-golang-sdk/v10/pkg/cloudbroker" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/config" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudapi" + "repository.basistech.ru/BASIS/dynamix-golang-sdk/v11/pkg/cloudbroker" ) type ClientInterface interface {