From d0aca6fff64ccc1146213221592b4e1fee1b5e7d Mon Sep 17 00:00:00 2001 From: qiwang <1364512070@qq.com> Date: Fri, 8 Mar 2024 15:40:35 +0800 Subject: [PATCH 1/2] fix:Add virtual machine interfaces Former-commit-id: de793003343c39f075d3906daf23046809c335b1 --- api/desc/pcm.api | 228 +++ api/desc/vm/pcm-vm.api | 1306 ++++++++++++++++- api/internal/handler/routes.go | 285 ++++ .../vm/addsecuritygrouptoserverhandler.go | 28 + .../vm/changeadministrativepasswordhandler.go | 28 + .../handler/vm/createfirewallgrouphandler.go | 28 + .../handler/vm/createfirewallpolicyhandler.go | 28 + .../handler/vm/createfirewallrulehandler.go | 28 + .../handler/vm/createflavorhandler.go | 28 + .../handler/vm/createfloatingiphandler.go | 28 + .../vm/createnetworksegmentrangehandler.go | 28 + api/internal/handler/vm/createporthandler.go | 28 + .../handler/vm/createrouterhandler.go | 28 + .../handler/vm/createsecuritygrouphandler.go | 28 + .../vm/createsecuritygrouprulehandler.go | 28 + .../handler/vm/deletefirewallgrouphandler.go | 28 + .../handler/vm/deletefirewallpolicyhandler.go | 28 + .../handler/vm/deletefirewallrulehandler.go | 28 + .../handler/vm/deleteflavorhandler.go | 28 + .../handler/vm/deletefloatingiphandler.go | 28 + .../vm/deletenetworksegmentrangeshandler.go | 28 + api/internal/handler/vm/deleteporthandler.go | 28 + .../handler/vm/deleterouterhandler.go | 28 + .../handler/vm/deletesecuritygrouphandler.go | 28 + .../vm/deletesecuritygrouprulehandler.go | 28 + .../handler/vm/deletesubnethandler.go | 28 + .../handler/vm/listfirewallgroupshandler.go | 28 + .../handler/vm/listfirewallpolicieshandler.go | 28 + .../handler/vm/listfirewallruleshandler.go | 28 + .../handler/vm/listfloatingipshandler.go | 28 + .../listnetworksegmentrangesrangehandler.go | 28 + api/internal/handler/vm/listportshandler.go | 28 + api/internal/handler/vm/listroutershandler.go | 28 + .../vm/listsecuritygroupruleshandler.go | 28 + .../handler/vm/listsecuritygroupshandler.go | 28 + api/internal/handler/vm/listsubnetshandler.go | 28 + .../handler/vm/migrateserverhandler.go | 28 + .../handler/vm/removesecuritygrouphandler.go | 28 + .../handler/vm/rescueserverhandler.go | 28 + .../handler/vm/resizeserverhandler.go | 28 + .../handler/vm/shelveserverhandler.go | 28 + .../vm/showfirewallgroupdetailshandler.go | 28 + .../vm/showfirewallpolicydetailshandler.go | 28 + .../vm/showfirewallruledetailshandler.go | 28 + .../vm/showfloatingipdetailshandler.go | 28 + .../shownetworksegmentrangedetailshandler.go | 28 + .../handler/vm/showportdetailshandler.go | 28 + .../handler/vm/showrouterdetailshandler.go | 28 + .../handler/vm/showsecuritygrouphandler.go | 28 + .../vm/showsecuritygrouprulehandler.go | 28 + .../handler/vm/suspendserverhandler.go | 28 + .../handler/vm/unpauseserverhandler.go | 28 + api/internal/handler/vm/unrescuehandler.go | 28 + .../handler/vm/updatefirewallgrouphandler.go | 28 + .../handler/vm/updatefloatingiphandler.go | 28 + .../vm/updatenetworksegmentrangeshandler.go | 28 + api/internal/handler/vm/updateporthandler.go | 28 + .../handler/vm/updaterouterhandler.go | 28 + .../handler/vm/updatesecuritygrouphandler.go | 28 + .../handler/vm/updatesubnethandler.go | 28 + .../logic/vm/addsecuritygrouptoserverlogic.go | 48 + .../vm/changeadministrativepasswordlogic.go | 48 + .../logic/vm/createfirewallgrouplogic.go | 48 + .../logic/vm/createfirewallpolicylogic.go | 48 + .../logic/vm/createfirewallrulelogic.go | 48 + api/internal/logic/vm/createflavorlogic.go | 48 + .../logic/vm/createfloatingiplogic.go | 48 + .../vm/createnetworksegmentrangelogic.go | 48 + api/internal/logic/vm/createportlogic.go | 48 + api/internal/logic/vm/createrouterlogic.go | 48 + .../logic/vm/createsecuritygrouplogic.go | 48 + .../logic/vm/createsecuritygrouprulelogic.go | 48 + .../logic/vm/deletefirewallgrouplogic.go | 48 + .../logic/vm/deletefirewallpolicylogic.go | 48 + .../logic/vm/deletefirewallrulelogic.go | 48 + api/internal/logic/vm/deleteflavorlogic.go | 48 + .../logic/vm/deletefloatingiplogic.go | 48 + .../vm/deletenetworksegmentrangeslogic.go | 48 + api/internal/logic/vm/deleteportlogic.go | 48 + api/internal/logic/vm/deleterouterlogic.go | 48 + .../logic/vm/deletesecuritygrouplogic.go | 48 + .../logic/vm/deletesecuritygrouprulelogic.go | 48 + api/internal/logic/vm/deletesubnetlogic.go | 48 + .../logic/vm/listfirewallgroupslogic.go | 48 + .../logic/vm/listfirewallpolicieslogic.go | 48 + .../logic/vm/listfirewallruleslogic.go | 48 + api/internal/logic/vm/listfloatingipslogic.go | 48 + .../vm/listnetworksegmentrangesrangelogic.go | 48 + api/internal/logic/vm/listportslogic.go | 48 + api/internal/logic/vm/listrouterslogic.go | 48 + .../logic/vm/listsecuritygroupruleslogic.go | 48 + .../logic/vm/listsecuritygroupslogic.go | 48 + api/internal/logic/vm/listsubnetslogic.go | 48 + api/internal/logic/vm/migrateserverlogic.go | 48 + .../logic/vm/removesecuritygrouplogic.go | 48 + api/internal/logic/vm/rescueserverlogic.go | 48 + api/internal/logic/vm/resizeserverlogic.go | 48 + api/internal/logic/vm/shelveserverlogic.go | 48 + .../logic/vm/showfirewallgroupdetailslogic.go | 48 + .../vm/showfirewallpolicydetailslogic.go | 48 + .../logic/vm/showfirewallruledetailslogic.go | 48 + .../logic/vm/showfloatingipdetailslogic.go | 48 + .../vm/shownetworksegmentrangedetailslogic.go | 48 + api/internal/logic/vm/showportdetailslogic.go | 48 + .../logic/vm/showrouterdetailslogic.go | 48 + .../logic/vm/showsecuritygrouplogic.go | 48 + .../logic/vm/showsecuritygrouprulelogic.go | 48 + api/internal/logic/vm/suspendserverlogic.go | 48 + api/internal/logic/vm/unpauseserverlogic.go | 48 + api/internal/logic/vm/unrescuelogic.go | 48 + .../logic/vm/updatefirewallgrouplogic.go | 48 + .../logic/vm/updatefloatingiplogic.go | 48 + .../vm/updatenetworksegmentrangeslogic.go | 48 + api/internal/logic/vm/updateportlogic.go | 48 + api/internal/logic/vm/updaterouterlogic.go | 48 + .../logic/vm/updatesecuritygrouplogic.go | 48 + api/internal/logic/vm/updatesubnetlogic.go | 48 + api/internal/types/types.go | 1285 +++++++++++++++- go.mod | 94 +- go.sum | 196 +-- 120 files changed, 7536 insertions(+), 190 deletions(-) create mode 100644 api/internal/handler/vm/addsecuritygrouptoserverhandler.go create mode 100644 api/internal/handler/vm/changeadministrativepasswordhandler.go create mode 100644 api/internal/handler/vm/createfirewallgrouphandler.go create mode 100644 api/internal/handler/vm/createfirewallpolicyhandler.go create mode 100644 api/internal/handler/vm/createfirewallrulehandler.go create mode 100644 api/internal/handler/vm/createflavorhandler.go create mode 100644 api/internal/handler/vm/createfloatingiphandler.go create mode 100644 api/internal/handler/vm/createnetworksegmentrangehandler.go create mode 100644 api/internal/handler/vm/createporthandler.go create mode 100644 api/internal/handler/vm/createrouterhandler.go create mode 100644 api/internal/handler/vm/createsecuritygrouphandler.go create mode 100644 api/internal/handler/vm/createsecuritygrouprulehandler.go create mode 100644 api/internal/handler/vm/deletefirewallgrouphandler.go create mode 100644 api/internal/handler/vm/deletefirewallpolicyhandler.go create mode 100644 api/internal/handler/vm/deletefirewallrulehandler.go create mode 100644 api/internal/handler/vm/deleteflavorhandler.go create mode 100644 api/internal/handler/vm/deletefloatingiphandler.go create mode 100644 api/internal/handler/vm/deletenetworksegmentrangeshandler.go create mode 100644 api/internal/handler/vm/deleteporthandler.go create mode 100644 api/internal/handler/vm/deleterouterhandler.go create mode 100644 api/internal/handler/vm/deletesecuritygrouphandler.go create mode 100644 api/internal/handler/vm/deletesecuritygrouprulehandler.go create mode 100644 api/internal/handler/vm/deletesubnethandler.go create mode 100644 api/internal/handler/vm/listfirewallgroupshandler.go create mode 100644 api/internal/handler/vm/listfirewallpolicieshandler.go create mode 100644 api/internal/handler/vm/listfirewallruleshandler.go create mode 100644 api/internal/handler/vm/listfloatingipshandler.go create mode 100644 api/internal/handler/vm/listnetworksegmentrangesrangehandler.go create mode 100644 api/internal/handler/vm/listportshandler.go create mode 100644 api/internal/handler/vm/listroutershandler.go create mode 100644 api/internal/handler/vm/listsecuritygroupruleshandler.go create mode 100644 api/internal/handler/vm/listsecuritygroupshandler.go create mode 100644 api/internal/handler/vm/listsubnetshandler.go create mode 100644 api/internal/handler/vm/migrateserverhandler.go create mode 100644 api/internal/handler/vm/removesecuritygrouphandler.go create mode 100644 api/internal/handler/vm/rescueserverhandler.go create mode 100644 api/internal/handler/vm/resizeserverhandler.go create mode 100644 api/internal/handler/vm/shelveserverhandler.go create mode 100644 api/internal/handler/vm/showfirewallgroupdetailshandler.go create mode 100644 api/internal/handler/vm/showfirewallpolicydetailshandler.go create mode 100644 api/internal/handler/vm/showfirewallruledetailshandler.go create mode 100644 api/internal/handler/vm/showfloatingipdetailshandler.go create mode 100644 api/internal/handler/vm/shownetworksegmentrangedetailshandler.go create mode 100644 api/internal/handler/vm/showportdetailshandler.go create mode 100644 api/internal/handler/vm/showrouterdetailshandler.go create mode 100644 api/internal/handler/vm/showsecuritygrouphandler.go create mode 100644 api/internal/handler/vm/showsecuritygrouprulehandler.go create mode 100644 api/internal/handler/vm/suspendserverhandler.go create mode 100644 api/internal/handler/vm/unpauseserverhandler.go create mode 100644 api/internal/handler/vm/unrescuehandler.go create mode 100644 api/internal/handler/vm/updatefirewallgrouphandler.go create mode 100644 api/internal/handler/vm/updatefloatingiphandler.go create mode 100644 api/internal/handler/vm/updatenetworksegmentrangeshandler.go create mode 100644 api/internal/handler/vm/updateporthandler.go create mode 100644 api/internal/handler/vm/updaterouterhandler.go create mode 100644 api/internal/handler/vm/updatesecuritygrouphandler.go create mode 100644 api/internal/handler/vm/updatesubnethandler.go create mode 100644 api/internal/logic/vm/addsecuritygrouptoserverlogic.go create mode 100644 api/internal/logic/vm/changeadministrativepasswordlogic.go create mode 100644 api/internal/logic/vm/createfirewallgrouplogic.go create mode 100644 api/internal/logic/vm/createfirewallpolicylogic.go create mode 100644 api/internal/logic/vm/createfirewallrulelogic.go create mode 100644 api/internal/logic/vm/createflavorlogic.go create mode 100644 api/internal/logic/vm/createfloatingiplogic.go create mode 100644 api/internal/logic/vm/createnetworksegmentrangelogic.go create mode 100644 api/internal/logic/vm/createportlogic.go create mode 100644 api/internal/logic/vm/createrouterlogic.go create mode 100644 api/internal/logic/vm/createsecuritygrouplogic.go create mode 100644 api/internal/logic/vm/createsecuritygrouprulelogic.go create mode 100644 api/internal/logic/vm/deletefirewallgrouplogic.go create mode 100644 api/internal/logic/vm/deletefirewallpolicylogic.go create mode 100644 api/internal/logic/vm/deletefirewallrulelogic.go create mode 100644 api/internal/logic/vm/deleteflavorlogic.go create mode 100644 api/internal/logic/vm/deletefloatingiplogic.go create mode 100644 api/internal/logic/vm/deletenetworksegmentrangeslogic.go create mode 100644 api/internal/logic/vm/deleteportlogic.go create mode 100644 api/internal/logic/vm/deleterouterlogic.go create mode 100644 api/internal/logic/vm/deletesecuritygrouplogic.go create mode 100644 api/internal/logic/vm/deletesecuritygrouprulelogic.go create mode 100644 api/internal/logic/vm/deletesubnetlogic.go create mode 100644 api/internal/logic/vm/listfirewallgroupslogic.go create mode 100644 api/internal/logic/vm/listfirewallpolicieslogic.go create mode 100644 api/internal/logic/vm/listfirewallruleslogic.go create mode 100644 api/internal/logic/vm/listfloatingipslogic.go create mode 100644 api/internal/logic/vm/listnetworksegmentrangesrangelogic.go create mode 100644 api/internal/logic/vm/listportslogic.go create mode 100644 api/internal/logic/vm/listrouterslogic.go create mode 100644 api/internal/logic/vm/listsecuritygroupruleslogic.go create mode 100644 api/internal/logic/vm/listsecuritygroupslogic.go create mode 100644 api/internal/logic/vm/listsubnetslogic.go create mode 100644 api/internal/logic/vm/migrateserverlogic.go create mode 100644 api/internal/logic/vm/removesecuritygrouplogic.go create mode 100644 api/internal/logic/vm/rescueserverlogic.go create mode 100644 api/internal/logic/vm/resizeserverlogic.go create mode 100644 api/internal/logic/vm/shelveserverlogic.go create mode 100644 api/internal/logic/vm/showfirewallgroupdetailslogic.go create mode 100644 api/internal/logic/vm/showfirewallpolicydetailslogic.go create mode 100644 api/internal/logic/vm/showfirewallruledetailslogic.go create mode 100644 api/internal/logic/vm/showfloatingipdetailslogic.go create mode 100644 api/internal/logic/vm/shownetworksegmentrangedetailslogic.go create mode 100644 api/internal/logic/vm/showportdetailslogic.go create mode 100644 api/internal/logic/vm/showrouterdetailslogic.go create mode 100644 api/internal/logic/vm/showsecuritygrouplogic.go create mode 100644 api/internal/logic/vm/showsecuritygrouprulelogic.go create mode 100644 api/internal/logic/vm/suspendserverlogic.go create mode 100644 api/internal/logic/vm/unpauseserverlogic.go create mode 100644 api/internal/logic/vm/unrescuelogic.go create mode 100644 api/internal/logic/vm/updatefirewallgrouplogic.go create mode 100644 api/internal/logic/vm/updatefloatingiplogic.go create mode 100644 api/internal/logic/vm/updatenetworksegmentrangeslogic.go create mode 100644 api/internal/logic/vm/updateportlogic.go create mode 100644 api/internal/logic/vm/updaterouterlogic.go create mode 100644 api/internal/logic/vm/updatesecuritygrouplogic.go create mode 100644 api/internal/logic/vm/updatesubnetlogic.go diff --git a/api/desc/pcm.api b/api/desc/pcm.api index 2651f6ee..d97734bf 100644 --- a/api/desc/pcm.api +++ b/api/desc/pcm.api @@ -398,6 +398,54 @@ service pcm { @handler PauseServerHandler post /vm/pauseServer (PauseServerReq) returns (PauseServerResp) + @doc "取消暂停虚拟机" + @handler UnpauseServerHandler + post /vm/UnpauseServer (UnpauseServerReq) returns (UnpauseServerResp) + + @doc "调整大小" + @handler ResizeServerHandler + post /vm/ResizeServer (ResizeServerReq) returns (ResizeServerResp) + + @doc "迁移" + @handler MigrateServerHandler + post /vm/MigrateServer (MigrateServerReq) returns (MigrateServerResp) + + @doc "搁置" + @handler ShelveServerHandler + post /vm/ShelveServer (ShelveServerReq) returns (ShelveServerResp) + + @doc "设置密码" + @handler ChangeAdministrativePasswordHandler + post /vm/ChangeAdministrativePassword (ChangeAdministrativePasswordReq) returns (ChangeAdministrativePasswordResp) + + @doc "救援" + @handler RescueServerHandler + post /vm/RescueServer (RescueServerReq) returns (RescueServerResp) + + @doc "取消救援" + @handler UnRescueHandler + post /vm/UnRescueServer (UnRescueServerReq) returns (UnRescueServerResp) + + @doc "中止" + @handler SuspendServerHandler + post /vm/SuspendServer (SuspendServerReq) returns (SuspendServerResp) + + @doc "将安全组添加到服务器" + @handler AddSecurityGroupToServerHandler + post /vm/AddSecurityGroupToServer (AddSecurityGroupToServerReq) returns (AddSecurityGroupToServerResp) + + @doc "从服务器中删除安全" + @handler removeSecurityGroupHandler + post /vm/removeSecurityGroup (removeSecurityGroupReq) returns (removeSecurityGroupResp) + + @doc "创建规格" + @handler CreateFlavorHandler + post /vm/CreateFlavor (CreateFlavorReq) returns (CreateFlavorResp) + + @doc "创建规格" + @handler DeleteFlavorHandler + post /vm/DeleteFlavor (DeleteFlavorReq) returns (DeleteFlavorResp) + @doc "查询镜像列表" @handler ListImagesHandler get /vm/listImages (ListImagesReq) returns (ListImagesResp) @@ -442,6 +490,186 @@ service pcm { @handler BulkCreateNetworksHandler post /vm/bulkCreateNetworks (BulkCreateNetworksReq) returns (BulkCreateNetworksResp) + @doc "查询子网列表" + @handler ListSubnetsHandler + get /vm/listSubnets (ListSubnetsReq) returns (ListSubnetsResp) + + @doc "删除子网" + @handler DeleteSubnetHandler + delete /vm/deleteSubnet (DeleteSubnetReq) returns (DeleteSubnetResp) + + @doc "修改子网" + @handler UpdateSubnetHandler + put /vm/updateSubnet (UpdateSubnetReq) returns (UpdateSubnetResp) + + @doc "查询网络列表" + @handler ListNetworkSegmentRangesRangeHandler + get /vm/listNetworkSegmentRanges (ListNetworkSegmentRangesReq) returns (ListNetworkSegmentRangesResp) + + @doc "创建网段" + @handler CreateNetworkSegmentRangeHandler + post /vm/createNetworkSegmentRange (CreateNetworkSegmentRangeReq) returns (CreateNetworkSegmentRangeResp) + + @doc "删除网段" + @handler DeleteNetworkSegmentRangesHandler + delete /vm/deleteNetworkSegmentRanges (DeleteNetworkSegmentRangesReq) returns (DeleteNetworkSegmentRangesResp) + + @doc "修改网段" + @handler UpdateNetworkSegmentRangesHandler + put /vm/updateNetworkSegmentRanges (UpdateNetworkSegmentRangesReq) returns (UpdateNetworkSegmentRangesResp) + + @doc "显示网段详情" + @handler ShowNetworkSegmentRangeDetailsHandler + get /vm/showNetworkSegmentRangeDetails (ShowNetworkSegmentRangeDetailsReq) returns (ShowNetworkSegmentRangeDetailsResp) + + @doc "创建端口" + @handler CreatePortHandler + post /vm/createPort (CreatePortReq) returns (CreatePortResp) + + @doc "查询端口列表" + @handler ListPortsHandler + get /vm/listPortsReq (ListPortsReq) returns (ListPortsResp) + + @doc "删除端口" + @handler DeletePortHandler + delete /vm/deletePort (DeletePortReq) returns (DeletePortResp) + + @doc "修改端口" + @handler UpdatePortHandler + put /vm/updatePort (UpdatePortReq) returns (UpdatePortResp) + + @doc "查询端口详情" + @handler ShowPortDetailsHandler + get /vm/showPortDetails (ShowPortDetailsReq) returns (ShowPortDetailsResp) + + @doc "创建路由" + @handler CreateRouterHandler + post /vm/createRouter (CreateRouterReq) returns (CreateRouterResp) + + @doc "查询路由列表" + @handler ListRoutersHandler + get /vm/listRouters (ListRoutersReq) returns (ListRoutersResp) + + @doc "删除路由" + @handler DeleteRouterHandler + delete /vm/deleteRouter (DeleteRouterReq) returns (DeleteRouterResp) + + @doc "修改路由" + @handler UpdateRouterHandler + put /vm/updateRouter (UpdateRouterReq) returns (UpdateRouterResp) + + @doc "查询路由详情" + @handler ShowRouterDetailsHandler + get /vm/showRouterDetails (ShowRouterDetailsReq) returns (ShowRouterDetailsResp) + + @doc "创建浮动ip" + @handler CreateFloatingIPHandler + post /vm/createFloatingIP (CreateFloatingIPReq) returns (CreateFloatingIPResp) + + @doc "查询浮动ip列表" + @handler ListFloatingIPsHandler + get /vm/ListFloatingIPs (ListFloatingIPsReq) returns (ListFloatingIPsResp) + + @doc "删除浮动ip" + @handler DeleteFloatingIPHandler + delete /vm/deleteFloatingIP (DeleteFloatingIPReq) returns (DeleteFloatingIPResp) + + @doc "修改浮动ip" + @handler UpdateFloatingIPHandler + put /vm/updateFloatingIP (UpdateFloatingIPReq) returns (UpdateFloatingIPResp) + + @doc "查询浮动ip详情" + @handler ShowFloatingIPDetailsHandler + get /vm/showFloatingIPDetails (ShowFloatingIPDetailsReq) returns (ShowFloatingIPDetailsResp) + + @doc "创建防火墙" + @handler CreateFirewallGroupHandler + post /vm/CreateFirewallGroup (CreateFirewallGroupReq) returns (CreateFirewallGroupResp) + + @doc "查询防火墙列表" + @handler ListFirewallGroupsHandler + get /vm/ListFirewallGroups (ListFirewallGroupsReq) returns (ListFirewallGroupsResp) + + @doc "删除防火墙" + @handler DeleteFirewallGroupHandler + delete /vm/DeleteFirewallGroup (DeleteFirewallGroupReq) returns (DeleteFirewallGroupResp) + + @doc "修改防火墙" + @handler UpdateFirewallGroupHandler + put /vm/UpdateFirewallGroup (UpdateFirewallGroupReq) returns (UpdateFirewallGroupResp) + + @doc "查询防火墙详情" + @handler ShowFirewallGroupDetailsHandler + get /vm/ShowFirewallGroupDetails (ShowFirewallGroupDetailsReq) returns (ShowFirewallGroupDetailsResp) + + @doc "创建防火墙策略" + @handler CreateFirewallPolicyHandler + post /vm/CreateFirewallPolicy (CreateFirewallPolicyReq) returns (CreateFirewallPolicyResp) + + @doc "查询防火墙策略列表" + @handler ListFirewallPoliciesHandler + get /vm/ListFirewallPolicies (ListFirewallPoliciesReq) returns (ListFirewallPoliciesResp) + + @doc "删除防火墙策略" + @handler DeleteFirewallPolicyHandler + delete /vm/DeleteFirewallPolicy (DeleteFirewallPolicyReq) returns (DeleteFirewallPolicyResp) + + @doc "查询防火墙策略详情" + @handler ShowFirewallRuleDetailsHandler + get /vm/ShowFirewallRuleDetails (ShowFirewallRuleDetailsReq) returns (ShowFirewallRuleDetailsResp) + + @doc "查询防火墙策略详情" + @handler ShowFirewallPolicyDetailsHandler + get /vm/ShowFirewallPolicyDetails (ShowFirewallPolicyDetailsReq) returns (ShowFirewallPolicyDetailsResp) + + @doc "创建防火墙策略" + @handler CreateFirewallRuleHandler + post /vm/CreateFirewallRule (CreateFirewallRuleReq) returns (CreateFirewallRuleResp) + + @doc "查询防火墙策略列表" + @handler ListFirewallRulesHandler + get /vm/ListFirewallRules (ListFirewallRulesReq) returns (ListFirewallRulesResp) + + @doc "删除防火墙策略" + @handler DeleteFirewallRuleHandler + delete /vm/DeleteFirewallRule (DeleteFirewallRuleReq) returns (DeleteFirewallRuleResp) + + @doc "创建安全组" + @handler CreateSecurityGroupHandler + post /vm/CreateSecurityGroup (CreateSecurityGroupReq) returns (CreateSecurityGroupResp) + + @doc "查询安全组列表" + @handler ListSecurityGroupsHandler + get /vm/ListSecurityGroups (ListSecurityGroupsReq) returns (ListSecurityGroupsResp) + + @doc "删除安全组" + @handler DeleteSecurityGroupHandler + delete /vm/DeleteSecurityGroup (DeleteSecurityGroupReq) returns (DeleteSecurityGroupResp) + + @doc "修改安全组" + @handler UpdateSecurityGroupHandler + put /vm/UpdateSecurityGroup (UpdateSecurityGroupReq) returns (UpdateSecurityGroupResp) + + @doc "查询安全组详情" + @handler ShowSecurityGroupHandler + get /vm/ShowSecurityGroup (ShowSecurityGroupReq) returns (ShowSecurityGroupResp) + + @doc "创建安全组规则" + @handler CreateSecurityGroupRuleHandler + post /vm/CreateSecurityGroupRule (CreateSecurityGroupRuleReq) returns (CreateSecurityGroupRuleResp) + + @doc "查询安全组规则列表" + @handler ListSecurityGroupRulesHandler + get /vm/ListSecurityGroupRules (ListSecurityGroupRulesReq) returns (ListSecurityGroupRulesResp) + + @doc "删除安全组规则" + @handler DeleteSecurityGroupRuleHandler + delete /vm/DeleteSecurityGroupRule (DeleteSecurityGroupRuleReq) returns (DeleteSecurityGroupRuleResp) + + @doc "查询安全组规则详情" + @handler ShowSecurityGroupRuleHandler + get /vm/ShowSecurityGroupRule (ShowSecurityGroupRuleReq) returns (ShowSecurityGroupRuleResp) + @doc "查询卷详情列表" @handler ListVolumesDetailHandler get /vm/listVolumesDetail (ListVolumesDetailReq) returns (ListVolumesDetailResp) diff --git a/api/desc/vm/pcm-vm.api b/api/desc/vm/pcm-vm.api index 4f06d977..724d0d45 100644 --- a/api/desc/vm/pcm-vm.api +++ b/api/desc/vm/pcm-vm.api @@ -38,6 +38,7 @@ type ( GetComputeLimitsReq { Limit int32 `json:"limit,optional"` OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` } GetComputeLimitsResp { @@ -69,6 +70,7 @@ type ( GetVolumeLimitsReq { Limit int32 `json:"limit,optional"` OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` } GetVolumeLimitsResp { @@ -83,6 +85,7 @@ type ( ListServersReq { Limit int32 `form:"limit,optional"` OffSet int32 `form:"offSet,optional"` + Platform string `json:"platform,optional"` } ListServersResp { TotalNumber uint32 `json:"totalNumber" copier:"TotalNumber"` @@ -112,7 +115,7 @@ type ( type ( ListServersDetailedReq { - + Platform string `json:"platform,optional"` } ListServersDetailedResp { ServersDetailed []ServersDetailed `json:"servers" copier:"ServersDetailed"` @@ -138,6 +141,7 @@ type ( type( GetServersDetailedByIdReq{ ServerId string `form:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` } GetServersDetailedByIdResp{ @@ -222,6 +226,7 @@ type( UpdateServerReq{ ServerId string `form:"server_id" copier:"ServerId"` ServerUpdate ServerUpdate `json:"server_update" copier:"ServerUpdate"` + Platform string `json:"platform,optional"` } ServerUpdate{ Server Server `json:"server" copier:"Server"` @@ -238,7 +243,7 @@ type ( ServerId string `json:"server_id" copier:"ServerId"` Action []map[string]string `json:"action,optional" copier:"Action"` start_action string `json:"start_action" copier:"start_action"` - + Platform string `json:"platform,optional"` } StartServerResp { Msg string `json:"msg,omitempty"` @@ -252,6 +257,7 @@ type( ServerId string `json:"server_id" copier:"ServerId"` Action []map[string]string `json:"action,optional" copier:"Action"` stop_action string `json:"stop_action" copier:"stop_action"` + Platform string `json:"platform,optional"` } StopServerResp { Msg string `json:"msg,omitempty"` @@ -263,6 +269,7 @@ type( RebootServerReq{ ServerId string `json:"server_id" copier:"ServerId"` Reboot Reboot `json:"reboot" copier:"Reboot"` + Platform string `json:"platform,optional"` } RebootServerResp { Msg string `json:"msg,omitempty"` @@ -278,6 +285,7 @@ type( ServerId string `json:"server_id" copier:"ServerId"` Action []map[string]string `json:"Action,optional" copier:"Action"` pause_action string `json:"pause_action" copier:"pause_action"` + Platform string `json:"platform,optional"` } PauseServerResp { Msg string `json:"msg,omitempty"` @@ -286,9 +294,24 @@ type( } ) +type( + UnpauseServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + unpause_action string `json:"unpause_action" copier:"unpause_action"` + Platform string `json:"platform,optional"` + } + UnpauseServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } +) + type ( DeleteServerReq { ServerId string `form:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` } DeleteServerResp { @@ -301,6 +324,7 @@ type ( type ( CreateServerReq { Server Server `json:"server" copier:"Server"` + Platform string `json:"platform,optional"` } CreateServerResp { Server ServerResp `json:"server" copier:"Server"` @@ -323,10 +347,10 @@ type ( Id string `json:"id" copier:"Id"` Links []Links `json:"links" copier:"Links"` OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` - SecurityGroups []Security_groups `json:"security_groups" copier:"SecurityGroups"` + SecurityGroups []Security_groups_server `json:"security_groups" copier:"SecurityGroups"` AdminPass string `json:"adminPass" copier:"AdminPass"` } - Security_groups { + Security_groups_server { Name string `json:"name" copier:"Name"` } Block_device_mapping_v2 { @@ -338,28 +362,231 @@ type ( } ) +type( + RebuildServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Rebuild Rebuild `json:"rebuild" copier:"Rebuild"` + } + RebuildServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + Rebuild { + ImageRef string `json:"imageRef" copier:"ImageRef"` + AccessIPv4 string `json:"accessIPv4" copier:"AccessIPv4"` + AccessIPv6 string `json:"accessIPv6" copier:"AccessIPv6"` + AdminPass string `json:"adminPass" copier:"AdminPass"` + Name string `json:"name" copier:"Name"` + PreserveEphemeral bool `json:"preserve_ephemeral" copier:"PreserveEphemeral"` + Description string `json:"description" copier:"Description"` + KeyName string `json:"key_name" copier:"KeyName"` + UserData string `json:"user_data" copier:"UserData"` + Hostname string `json:"hostname" copier:"Hostname"` + Metadata MetadataServer `json:"metadata" copier:"Metadata"` + Personality []Personality `json:"personality" copier:"Personality"` + trusted_image_certificates []Trusted_image_certificates `json:"trusted_image_certificates" copier:"trusted_image_certificates"` + } + MetadataServer { + + } + Personality { + Path string `json:"path" copier:"Path"` + Contents string `json:"contents" copier:"Contents"` + } + Trusted_image_certificates{ + + } +) + +type( + ResizeServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Resize Resize `json:"resize" copier:"Resize"` + } + ResizeServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + Resize{ + flavorRef string `json:"flavorRef" copier:"flavorRef"` + } +) + +type( + MigrateServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + MigrateAction string `json:"migrate_action,optional" copier:"MigrateAction"` + Migrate Migrate `json:"migrate" copier:"Migrate"` + } + MigrateServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + Migrate{ + host []map[string]string `json:"host,optional" copier:"host"` + } +) + +type( + ShelveServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + shelve_action string `json:"shelve_action" copier:"shelve_action"` + Platform string `json:"platform,optional"` + } + ShelveServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } +) + +type( + RescueServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Rescue Rescue `json:"rescue" copier:"Rescue"` + } + RescueServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + Rescue{ + AdminPass string `json:"adminPass" copier:"AdminPass"` + RescueImageRef string `json:"rescue_image_ref" copier:"RescueImageRef"` + } +) + +type( + UnRescueServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Platform string `json:"platform,optional"` + UnRescue_action string `json:"UnRescue_action" copier:"UnRescue_action"` + Rescue Rescue `json:"rescue" copier:"Rescue"` + } + UnRescueServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } +) + +type( + ChangeAdministrativePasswordReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Changepassword string `json:"changePassword" copier:"Changepassword"` + Platform string `json:"platform,optional"` + ChangePassword ChangePassword `json:"changepassword" copier:"ChangePassword"` + } + ChangeAdministrativePasswordResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + ChangePassword { + AdminPass string `json:"adminPass" copier:"AdminPass"` + } +) + +type( + SuspendServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Platform string `json:"platform,optional"` + UnRescue_action string `json:"UnRescue_action" copier:"UnRescue_action"` + Rescue Rescue `json:"rescue" copier:"Rescue"` + } + SuspendServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } +) + +type( + AddSecurityGroupToServerReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Platform string `json:"platform,optional"` + UnRescue_action string `json:"UnRescue_action" copier:"UnRescue_action"` + AddSecurityGroup AddSecurityGroup `json:"addSecurityGroup" copier:"AddSecurityGroup"` + } + AddSecurityGroupToServerResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + AddSecurityGroup { + Name string `json:"name" copier:"Name"` + } +) + +type( + removeSecurityGroupReq{ + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + RemoveSecurityGroup RemoveSecurityGroup `json:"removeSecurityGroup" copier:"RemoveSecurityGroup"` + } + removeSecurityGroupResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + RemoveSecurityGroup { + Name string `json:"name" copier:"Name"` + } +) + +type( + CreateFlavorReq{ + Platform string `json:"platform,optional"` + Flavor FlavorServer `json:"flavor" copier:"Flavor"` + } + CreateFlavorResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } + FlavorServer { + Name string `json:"name" copier:"Name"` + Ram uint32 `json:"ram" copier:"Ram"` + disk uint32 `json:"disk" copier:"disk"` + vcpus uint32 `json:"vcpus" copier:"vcpus"` + id string `json:"id" copier:"id"` + rxtx_factor float64 `json:"rxtx_factor" copier:"rxtx_factor"` + description string `json:"description" copier:"description"` + } +) + +type( + DeleteFlavorReq{ + Platform string `json:"platform,optional"` + ServerId string `json:"server_id" copier:"ServerId"` + FlavorId string `json:"flavor_id" copier:"FlavorId"` + } + DeleteFlavorResp { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` + } +) + /****************** servers end*************************/ /******************find images end*************************/ type ( ListImagesReq { Limit int32 `form:"limit,optional"` - - // Marker string `json:"marker" copier:"Marker"` - // Name string `json:"name" copier:"Name"` - // Owner string `json:"owner" copier:"Owner"` - // Protected bool `json:"protected" copier:"Protected"` - // Status int32 `json:"status" copier:"Status"` - // Visibility int32 `json:"visibility" copier:"Visibility"` - // Os_hidden bool `json:"os_hidden" copier:"Os_hidden"` - // Member_status string `json:"member_status" copier:"Member_status"` - // Size_max string `json:"size_max" copier:"Size_max"` - // Size_min string `json:"size_min" copier:"Size_min"` - // Created_at string `json:"created_at" copier:"Created_at"` - // Updated_at string `json:"updated_at" copier:"Updated_at"` - // Sort_dir string `json:"sort_dir" copier:"Sort_dir"` - // Sort_key string `json:"sort_key" copier:"Sort_key"` - // Sort string `json:"sort" copier:"Sort"` + Platform string `json:"platform,optional"` } ListImagesResp { First string `json:"first" copier:"First"` @@ -406,7 +633,7 @@ type ( Min_ram int32 `json:"min_ram" copier:"Min_ram"` Name string `json:"name" copier:"Name"` Protected bool `json:"protected" copier:"Protected"` - //Tags []Tags `json:"tags" copier:"Tags"` + Platform string `json:"platform,optional"` Visibility string `json:"visibility" copier:"Visibility"` } CreateImageResp { @@ -428,6 +655,7 @@ type ( type ( UploadOsImageReq { ImageId string `form:"image_id" copier:"ImageId"` + Platform string `json:"platform,optional"` } UploadOsImageResp { Code int32 `json:"code,omitempty" copier:"Code"` @@ -439,6 +667,7 @@ type ( type ( DeleteImageReq { ImageId string `form:"image_id" copier:"ImageId"` + Platform string `json:"platform,optional"` } DeleteImageResp { Code int32 `json:"code,omitempty"` @@ -451,7 +680,7 @@ type ( /******************find Networks end*************************/ type ( ListNetworksReq { - + Platform string `json:"platform,optional"` } ListNetworksResp { Networks []Network `json:"networks" copier:"Networks"` @@ -490,6 +719,7 @@ type ( type ( DeleteNetworkReq { NetworkId string `form:"network_id" copier:"NetworkId"` + Platform string `json:"platform,optional"` } DeleteNetworkResp { Code int32 `json:"code,omitempty" copier:"Code"` @@ -500,6 +730,7 @@ type ( type ( CreateNetworkReq { Network CreateNetwork `json:"network" copier:"Network"` + Platform string `json:"platform,optional"` } CreateNetworkResp { Network Network `json:"network" copier:"Network"` @@ -517,6 +748,7 @@ type ( type ( CreateSubnetReq { Subnet Subnet `json:"subnet" copier:"Subnet"` + Platform string `json:"platform,optional"` } CreateSubnetResp { Subnet SubnetResp `json:"subnet" copier:"Subnet"` @@ -569,6 +801,7 @@ type ( type( ShowNetworkDetailsReq{ NetworkId string `form:"network_id" copier:"NetworkId"` + Platform string `json:"platform,optional"` } ShowNetworkDetailsResp{ Network Networkdetail `json:"network" copier:"Network"` @@ -607,7 +840,7 @@ type( UpdateNetworkReq { NetworkId string `form:"network_id" copier:"NetworkId"` Network Network `json:"network" copier:"Network"` - + Platform string `json:"platform,optional"` } UpdateNetworkResp { Network Network `json:"network" copier:"Network"` @@ -620,6 +853,7 @@ type( type( BulkCreateNetworksReq { Network []CreateNetwork `json:"network" copier:"Network"` + Platform string `json:"platform,optional"` } BulkCreateNetworksResp { Network []Network `json:"network" copier:"Network"` @@ -628,12 +862,1020 @@ type( ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } ) + +type( + ListSubnetsReq { + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` + } + ListSubnetsResp { + Subnets []Subnets `json:"subnets" copier:"Subnets"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Subnets { + Name string `json:"name,optional" copier:"Name"` + Enable_dhcp bool `json:"enable_dhcp,optional" copier:"Enable_dhcp"` + NetworkId string `json:"network_id,optional" copier:"NetworkId"` + SegmentId string `json:"segment_id,optional" copier:"SegmentId"` + ProjectId string `json:"project_id,optional" copier:"ProjectId"` + TenantId string `json:"tenant_id,optional" copier:"TenantId"` + DnsNameservers string `json:"dns_nameservers,optional" copier:"DnsNameservers"` + dns_publish_fixed_ip bool `json:"dns_publish_fixed_ip,optional" copier:"dns_publish_fixed_ip"` + allocation_pools []Allocation_pool `json:"allocation_pools,optional" copier:"allocation_pools"` + host_routes []string `json:"host_routes,optional" copier:"host_routes"` + ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + gateway_ip string `json:"gateway_ip,optional" copier:"gateway_ip"` + cidr string `json:"cidr,optional" copier:"cidr"` + id string `json:"id,optional" copier:"id"` + description string `json:"description,optional" copier:"description"` + ipv6_address_mode string `json:"ipv6_address_mode,optional" copier:"ipv6_address_mode"` + ipv6_ra_mode string `json:"ipv6_ra_mode,optional" copier:"ipv6_ra_mode"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + service_types []string `json:"service_types,optional" copier:"service_types"` + subnetpool_id string `json:"subnetpool_id,optional" copier:"subnetpool_id"` + tags []string `json:"tags,optional" copier:"tags"` + updated_at string `json:"updated_at,optional" copier:"updated_at"` + } + Allocation_pool { + start string `json:"start,optional" copier:"start"` + end string `json:"end,optional" copier:"end"` + } +) + +type( + DeleteSubnetReq{ + subnetId string `json:"subnet_id,optional" copier:"subnetId"` + Platform string `json:"platform,optional" copier:"Platform"` + } + DeleteSubnetResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + UpdateSubnetReq{ + subnetId string `json:"subnet_id,optional" copier:"subnetId"` + Platform string `json:"platform,optional" copier:"Platform"` + } + UpdateSubnetResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + CreateNetworkSegmentRangeReq{ + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Platform string `json:"platform,optional" copier:"Platform"` + } + CreateNetworkSegmentRangeResp{ + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Network_segment_range { + id string `json:"id,optional" copier:"id"` + name string `json:"name,optional" copier:"name"` + description string `json:"description,optional" copier:"description"` + shared bool `json:"shared,optional" copier:"shared"` + project_id string `json:"project_id,optional" copier:"project_id"` + network_type string `json:"network_type,optional" copier:"network_type"` + physical_network string `json:"physical_network,optional" copier:"physical_network"` + minimum uint32 `json:"minimum,optional" copier:"minimum"` + maximum uint32 `json:"maximum,optional" copier:"maximum"` + available []uint32 `json:"available,optional" copier:"available"` + used Used `json:"used,optional" copier:"used"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + tags []string `json:"tags,optional" copier:"tags"` + } + Used { + } +) + +type ( + ListNetworkSegmentRangesReq{ + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` + } + + ListNetworkSegmentRangesResp{ + NetworkSegmentRange []Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + + Network_segment_ranges { + id string `json:"id,optional" copier:"id"` + name string `json:"name,optional" copier:"name"` + description string `json:"description,optional" copier:"description"` + shared bool `json:"shared,optional" copier:"shared"` + project_id string `json:"project_id,optional" copier:"project_id"` + network_type string `json:"network_type,optional" copier:"network_type"` + physical_network string `json:"physical_network,optional" copier:"physical_network"` + minimum uint32 `json:"minimum,optional" copier:"minimum"` + maximum uint32 `json:"maximum,optional" copier:"maximum"` + available []uint32 `json:"available,optional" copier:"available"` + used Used `json:"used,optional" copier:"used"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + tags []string `json:"tags,optional" copier:"tags"` + } +) + +type( + DeleteNetworkSegmentRangesReq{ + network_segment_range_id string `json:"network_segment_range_id,optional" copier:"network_segment_range_id"` + Platform string `json:"platform,optional"` + } + DeleteNetworkSegmentRangesResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + UpdateNetworkSegmentRangesReq{ + network_segment_range_id string `json:"network_segment_range_id,optional" copier:"network_segment_range_id"` + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Platform string `json:"platform,optional" copier:"Platform"` + } + UpdateNetworkSegmentRangesResp{ + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + ShowNetworkSegmentRangeDetailsReq{ + network_segment_range_id string `json:"network_segment_range_id,optional" copier:"network_segment_range_id"` + Platform string `json:"platform,optional" copier:"Platform"` + } + ShowNetworkSegmentRangeDetailsResp{ + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +// port +type( + CreatePortReq{ + port Port `json:"port,optional" copier:"port"` + Platform string `json:"platform,optional" copier:"Platform"` + } + Port{ + admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + dns_domain string `json:"dns_domain,optional" copier:"dns_domain"` + dns_name string `json:"dns_name,optional" copier:"dns_name"` + name string `json:"name,optional" copier:"name"` + network_id string `json:"network_id,optional" copier:"network_id"` + qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` + port_security_enabled bool `json:"port_security_enabled,optional" copier:"port_security_enabled"` + allowed_address_pairs []Allowed_address_pairs `json:"allowed_address_pairs,optional" copier:"allowed_address_pairs"` + propagate_uplink_status bool `json:"propagate_uplink_status,optional" copier:"propagate_uplink_status"` + hardware_offload_type string `json:"hardware_offload_type,optional" copier:"hardware_offload_type"` + created_at string `json:"created_at,optional" copier:"created_at"` + data_plane_status string `json:"data_plane_status,optional" copier:"data_plane_status"` + description string `json:"description,optional" copier:"description"` + device_id string `json:"device_id,optional" copier:"device_id"` + device_owner string `json:"device_owner,optional" copier:"device_owner"` + dns_assignment Dns_assignment `json:"dns_assignment,optional" copier:"dns_assignment"` + id string `json:"id,optional" copier:"id"` + ip_allocation string `json:"ip_allocation,optional" copier:"ip_allocation"` + mac_address string `json:"mac_address,optional" copier:"mac_address"` + project_id string `json:"project_id,optional" copier:"project_id"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + security_groups []string `json:"security_groups,optional" copier:"revision_number"` + status uint32 `json:"status,optional" copier:"revision_number"` + tags []string `json:"tags,optional" copier:"tags"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + updated_at string `json:"updated_at,optional" copier:"updated_at"` + qos_network_policy_id string `json:"qos_network_policy_id,optional" copier:"qos_network_policy_id"` + } + Allowed_address_pairs { + ip_address string `json:"ip_address,optional" copier:"ip_address"` + mac_address string `json:"mac_address,optional" copier:"mac_address"` + } + CreatePortResp{ + port Port `json:"port,optional" copier:"port"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type ( + ListPortsReq{ + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` + } + ListPortsResp{ + ports []PortLists `json:"ports,optional" copier:"ports"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + PortLists { + admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + allowed_address_pairs []Allowed_address_pairs `json:"allowed_address_pairs,optional" copier:"allowed_address_pairs"` + created_at string `json:"created_at,optional" copier:"created_at"` + data_plane_status string `json:"data_plane_status,optional" copier:"data_plane_status"` + description string `json:"description,optional" copier:"description"` + device_id string `json:"device_id,optional" copier:"device_id"` + device_owner string `json:"device_owner,optional" copier:"device_owner"` + dns_assignment []Dns_assignment `json:"dns_assignment,optional" copier:"dns_assignment"` + extra_dhcp_opts []Extra_dhcp_opts `json:"extra_dhcp_opts,optional" copier:"extra_dhcp_opts"` + fixed_ips []Fixed_ips `json:"fixed_ips,optional" copier:"fixed_ips"` + id string `json:"id,optional" copier:"id"` + ip_allocation string `json:"ip_allocation,optional" copier:"ip_allocation"` + mac_address string `json:"mac_address,optional" copier:"mac_address"` + name string `json:"name,optional" copier:"name"` + network_id string `json:"network_id,optional" copier:"network_id"` + port_security_enabled bool `json:"port_security_enabled,optional" copier:"port_security_enabled"` + project_id string `json:"project_id,optional" copier:"project_id"` + revision_number uint32 `json:"project_id,optional" copier:"project_id"` + security_groups []string `json:"security_groups,optional" copier:"security_groups"` + status string `json:"status,optional" copier:"status"` + tags []string `json:"tags,optional" copier:"tags"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + updated_at string `json:"updated_at,optional" copier:"updated_at"` + qos_network_policy_id string `json:"qos_network_policy_id,optional" copier:"qos_network_policy_id"` + qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` + propagate_uplink_status bool `json:"propagate_uplink_status,optional" copier:"propagate_uplink_status"` + hardware_offload_type string `json:"hardware_offload_type,optional" copier:"hardware_offload_type"` + } + Dns_assignment { + hostname string `json:"hostname,optional" copier:"hostname"` + ip_address string `json:"ip_address,optional" copier:"ip_address"` + opt_name string `json:"opt_name,optional" copier:"opt_name"` + } + Extra_dhcp_opts { + opt_value string `json:"opt_value,optional" copier:"opt_value"` + ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + fqdn string `json:"fqdn,optional" copier:"fqdn"` + } + Fixed_ips { + ip_address string `json:"ip_address,optional" copier:"ip_address"` + subnet_id string `json:"subnet_id,optional" copier:"subnet_id"` + } +) + +type( + DeletePortReq{ + port_id string `json:"port_id,optional" copier:"port_id"` + platform string `json:"platform,optional" copier:"platform"` + } + DeletePortResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + UpdatePortReq{ + port_id string `json:"port_id,optional" copier:"port_id"` + port Port `json:"port,optional" copier:"port"` + platform string `json:"platform,optional" copier:"platform"` + } + UpdatePortResp{ + port Port `json:"port,optional" copier:"port"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + ShowPortDetailsReq{ + port_id string `json:"port_id,optional" copier:"port_id"` + fields string `json:"fields,optional" copier:"fields"` + platform string `json:"platform,optional" copier:"platform"` + } + ShowPortDetailsResp{ + port Port `json:"port,optional" copier:"port"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +//Router +type( + ListRoutersReq{ + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` + } + ListRoutersResp{ + routers []Routers `json:"routers,optional" copier:"routers"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Routers{ + admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + availability_zone_hints []Availability_zone_hints `json:"availability_zone_hints,optional" copier:"availability_zone_hints"` + availability_zones []string `json:"availability_zones,optional" copier:"availability_zones"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + description string `json:"description,optional" copier:"description"` + distributed string `json:"distributed,optional" copier:"distributed"` + external_gateway_info External_gateway_info `json:"external_gateway_info,optional" copier:"external_gateway_info"` + flavor_id string `json:"flavor_id,optional" copier:"flavor_id"` + ha bool `json:"ha,optional" copier:"ha"` + id bool `json:"id,optional" copier:"id"` + name string `json:"name,optional" copier:"name"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + routes []Routes `json:"routes,optional" copier:"routes"` + status string `json:"status,optional" copier:"status"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + project_id string `json:"project_id,optional" copier:"project_id"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + service_type_id string `json:"service_type_id,optional" copier:"service_type_id"` + tags []string `json:"tags,optional" copier:"tags"` + conntrack_helpers Conntrack_helpers `json:"conntrack_helpers,optional" copier:"conntrack_helpers"` + } + Availability_zone_hints{ + + } + External_gateway_info{ + enable_snat string `json:"enable_snat,optional" copier:"enable_snat"` + external_fixed_ips []External_fixed_ips `json:"external_fixed_ips,optional" copier:"external_fixed_ips"` + platform string `json:"platform,optional" copier:"platform"` + } + External_fixed_ips{ + destination string `json:"destination,optional" copier:"destination"` + subnet_id string `json:"subnet_id,optional" copier:"subnet_id"` + } + Routes{ + ip_address string `json:"ip_address,optional" copier:"ip_address"` + nexthop string `json:"nexthop,optional" copier:"nexthop"` + } + Conntrack_helpers{ + protocol string `json:"protocol,optional" copier:"protocol"` + helper string `json:"helper,optional" copier:"helper"` + port uint32 `json:"port,optional" copier:"port"` + + } +) + +type( + CreateRouterReq{ + router Router `json:"router,optional" copier:"router"` + Platform string `json:"platform,optional" copier:"Platform"` + } + CreateRouterResp{ + router Router `json:"router,optional" copier:"router"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Router{ + name string `json:"name,optional" copier:"name"` + external_gateway_info External_gateway_info `json:"external_gateway_info,optional" copier:"external_gateway_info"` + admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + availability_zone_hints []Availability_zone_hints `json:"availability_zone_hints,optional" copier:"availability_zone_hints"` + availability_zones []string `json:"availability_zones,optional" copier:"availability_zones"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + description string `json:"description,optional" copier:"description"` + distributed bool `json:"distributed,optional" copier:"distributed"` + flavor_id string `json:"flavor_id,optional" copier:"flavor_id"` + ha bool `json:"ha,optional" copier:"ha"` + id string `json:"id,optional" copier:"id"` + routers []Routers `json:"routers,optional" copier:"routers"` + status string `json:"status,optional" copier:"status"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + project_id string `json:"project_id,optional" copier:"project_id"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + service_type_id string `json:"service_type_id,optional" copier:"service_type_id"` + tags []string `json:"tags,optional" copier:"tags"` + conntrack_helpers Conntrack_helpers `json:"conntrack_helpers,optional" copier:"conntrack_helpers"` + } +) + +type( + UpdateRouterReq{ + router Router `json:"router,optional" copier:"router"` + Platform string `json:"platform,optional" copier:"Platform"` + + } + UpdateRouterResp{ + router Router `json:"router,optional" copier:"router"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + ShowRouterDetailsReq{ + router Router `json:"router,optional" copier:"router"` + Platform string `json:"platform,optional" copier:"Platform"` + + } + ShowRouterDetailsResp{ + router Router `json:"router,optional" copier:"router"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + DeleteRouterReq{ + Platform string `json:"platform,optional" copier:"Platform"` + router_id string `json:"router_id,optional" copier:"router_id"` + } + DeleteRouterResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +//浮动IPs +type( + ListFloatingIPsReq{ + Platform string `json:"platform,optional" copier:"Platform"` + Limit int32 `json:"limit,optional" copier:"Limit"` + OffSet int32 `json:"offSet,optional" copier:"OffSet"` + } + ListFloatingIPsResp{ + floatingips []Floatingips `json:"floatingips,omitempty" copier:"floatingips"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Floatingips{ + router_id string `json:"router_id,optional" copier:"router_id"` + description string `json:"description,optional" copier:"description"` + dns_domain string `json:"dns_domain,optional" copier:"dns_domain"` + dns_name string `json:"dns_name,optional" copier:"dns_name"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + project_id string `json:"project_id,optional" copier:"project_id"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + floating_network_id string `json:"floating_network_id,optional" copier:"floating_network_id"` + fixed_ip_address string `json:"fixed_ip_address,optional" copier:"fixed_ip_address"` + floating_ip_address string `json:"floating_ip_address,optional" copier:"floating_ip_address"` + port_id string `json:"port_id,optional" copier:"port_id"` + id string `json:"id,optional" copier:"id"` + status string `json:"status,optional" copier:"status"` + port_details Port_details `json:"port_details,optional" copier:"port_details"` + tags []string `json:"tags,optional" copier:"tags"` + port_forwardings []Port_forwardings `json:"port_forwardings,optional" copier:"port_forwardings"` + qos_network_policy_id string `json:"qos_network_policy_id,optional" copier:"qos_network_policy_id"` + qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` + } + Port_details{ + status string `json:"status,optional" copier:"status"` + name string `json:"name,optional" copier:"name"` + admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + network_id string `json:"network_id,optional" copier:"network_id"` + device_owner string `json:"device_owner,optional" copier:"device_owner"` + mac_address string `json:"mac_address,optional" copier:"mac_address"` + device_id string `json:"device_id,optional" copier:"device_id"` + } + Port_forwardings{ + protocol string `json:"protocol,optional" copier:"protocol"` + internal_ip_address string `json:"internal_ip_address,optional" copier:"internal_ip_address"` + internal_port string `json:"internal_port,optional" copier:"internal_port"` + internal_port_id string `json:"internal_port_id,optional" copier:"internal_port_id"` + id string `json:"id,optional" copier:"id"` + } +) + +type( + CreateFloatingIPReq{ + floatingip Floatingip `json:"floatingip,optional" copier:"floatingip"` + Platform string `json:"platform,optional" copier:"Platform"` + } + CreateFloatingIPResp{ + floatingip Floatingip `json:"floatingip,omitempty" copier:"floatingip"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Floatingip{ + fixed_ip_address string `json:"fixed_ip_address,optional" copier:"fixed_ip_address"` + floating_ip_address string `json:"floating_ip_address,optional" copier:"floating_ip_address"` + floating_network_id string `json:"floating_network_id,optional" copier:"floating_network_id"` + id string `json:"id,optional" copier:"id"` + port_id string `json:"port_id,optional" copier:"port_id"` + router_id string `json:"router_id,optional" copier:"router_id"` + status string `json:"status,optional" copier:"status"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + description string `json:"description,optional" copier:"description"` + dns_domain string `json:"dns_domain,optional" copier:"dns_domain"` + dns_name string `json:"dns_name,optional" copier:"dns_name"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + tags []string `json:"tags,optional" copier:"tags"` + port_details Port_details `json:"port_details,optional" copier:"port_details"` + port_forwardings []Port_forwardings `json:"port_forwardings,optional" copier:"port_forwardings"` + qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` + } +) + +type ( + UpdateFloatingIPReq{ + Platform string `json:"platform,optional" copier:"Platform"` + floatingip_id string `json:"floatingip_id,optional" copier:"floatingip_id"` + floatingip Floatingip `json:"floatingip,optional" copier:"floatingip"` + } + UpdateFloatingIPResp{ + floatingip Floatingip `json:"floatingip,omitempty" copier:"floatingip"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type ( + DeleteFloatingIPReq{ + Platform string `json:"platform,optional" copier:"Platform"` + floatingip_id string `json:"floatingip_id,optional" copier:"floatingip_id"` + } + DeleteFloatingIPResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type ( + ShowFloatingIPDetailsReq{ + Platform string `json:"platform,optional" copier:"Platform"` + floatingip_id string `json:"floatingip_id,optional" copier:"floatingip_id"` + } + ShowFloatingIPDetailsResp{ + floatingip Floatingip `json:"floatingip,omitempty" copier:"floatingip"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +//firewall +type ( + ListFirewallGroupsReq{ + Platform string `json:"platform,optional" copier:"Platform"` + fields string `json:"fields,optional" copier:"fields"` + } + ListFirewallGroupsResp{ + firewall_groups Firewall_groups `json:"firewall_groups,omitempty" copier:"firewall_groups"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Firewall_groups { + AdminStateUp bool `json:"admin_state_up,optional" copier:"AdminStateUp"` + description string `json:"description,optional" copier:"description"` + egress_firewall_policy_id string `json:"egress_firewall_policy_id,optional" copier:"egress_firewall_policy_id"` + id string `json:"id,optional" copier:"id"` + ingress_firewall_policy_id string `json:"ingress_firewall_policy_id,optional" copier:"ingress_firewall_policy_id"` + name string `json:"name,optional" copier:"name"` + ports []string `json:"ports,optional" copier:"ports"` + shared bool `json:"shared,optional" copier:"shared"` + project_id string `json:"project_id,optional" copier:"project_id"` + status string `json:"status,optional" copier:"status"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + } +) + +type( + DeleteFirewallGroupReq { + firewall_group_id string `json:"firewall_group_id,optional" copier:"firewall_group_id"` + Platform string `json:"platform,optional" copier:"Platform"` + } + DeleteFirewallGroupResp { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + CreateFirewallGroupReq{ + firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Platform string `json:"platform,optional" copier:"Platform"` + } + CreateFirewallGroupResp{ + firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Firewall_group { + admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + egress_firewall_policy_id string `json:"egress_firewall_policy_id,optional" copier:"egress_firewall_policy_id"` + ingress_firewall_policy_id string `json:"ingress_firewall_policy_id,optional" copier:"ingress_firewall_policy_id"` + description string `json:"description,optional" copier:"description"` + id string `json:"id,optional" copier:"id"` + name string `json:"name,optional" copier:"name"` + ports []string `json:"ports,optional" copier:"ports"` + project_id string `json:"project_id,optional" copier:"project_id"` + shared bool `json:"shared,optional" copier:"shared"` + status string `json:"status,optional" copier:"status"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + } +) + +type ( + UpdateFirewallGroupReq{ + firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Platform string `json:"platform,optional" copier:"Platform"` + firewall_group_id string `json:"firewall_group_id,optional" copier:"firewall_group_id"` + } + UpdateFirewallGroupResp{ + firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type ( + ShowFirewallGroupDetailsReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_group_id string `json:"firewall_group_id,optional" copier:"firewall_group_id"` + } + ShowFirewallGroupDetailsResp{ + firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + CreateFirewallPolicyReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_policy Firewall_policy `json:"firewall_policy,optional" copier:"firewall_policy"` + } + CreateFirewallPolicyResp{ + firewall_policy Firewall_policy `json:"firewall_policy,optional" copier:"firewall_policy"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Firewall_policy{ + name string `json:"name,optional" copier:"name"` + firewall_rules []string `json:"firewall_rules,optional" copier:"firewall_rules"` + audited bool `json:"audited,optional" copier:"audited"` + description string `json:"description,optional" copier:"description"` + id string `json:"id,optional" copier:"id"` + project_id string `json:"project_id,optional" copier:"project_id"` + shared bool `json:"shared,optional" copier:"shared"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + } +) + +type( + DeleteFirewallPolicyReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_policy_id string `json:"firewall_policy_id,optional" copier:"firewall_policy_id"` + } + DeleteFirewallPolicyResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + ListFirewallPoliciesReq{ + Platform string `json:"platform,optional" copier:"Platform"` + fields string `json:"fields,optional" copier:"fields"` + } + ListFirewallPoliciesResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + firewall_policies []Firewall_policies `json:"firewall_policies,optional" copier:"firewall_policies"` + + } + Firewall_policies{ + audited bool `json:"audited,optional" copier:"audited"` + description string `json:"description,optional" copier:"description"` + firewall_rules []string `json:"firewall_rules,optional" copier:"firewall_rules"` + id string `json:"id,optional" copier:"id"` + name string `json:"name,optional" copier:"name"` + project_id string `json:"project_id,optional" copier:"project_id"` + shared bool `json:"shared,optional" copier:"shared"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + } +) + +type( + ShowFirewallPolicyDetailsReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_policy_id string `json:"firewall_policy_id,optional" copier:"firewall_policy_id"` + } + ShowFirewallPolicyDetailsResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + firewall_policy Firewall_policy `json:"firewall_policy,optional" copier:"firewall_policy"` + } +) + +type( + CreateFirewallRuleReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_rule Firewall_rule `json:"firewall_rule,optional" copier:"firewall_rule"` + } + CreateFirewallRuleResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + firewall_rule Firewall_rule `json:"firewall_rule,optional" copier:"firewall_rule"` + } + Firewall_rule { + action string `json:"action,optional" copier:"action"` + description string `json:"description,optional" copier:"description"` + destination_ip_address string `json:"destination_ip_address,optional" copier:"destination_ip_address"` + destination_firewall_group_id string `json:"destination_firewall_group_id,optional" copier:"destination_firewall_group_id"` + destination_port string `json:"destination_port,optional" copier:"destination_port"` + enabled bool `json:"enabled,optional" copier:"enabled"` + id string `json:"id,optional" copier:"id"` + ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + name string `json:"name,optional" copier:"name"` + project_id string `json:"project_id,optional" copier:"project_id"` + protocol string `json:"protocol,optional" copier:"protocol"` + shared bool `json:"shared,optional" copier:"shared"` + source_firewall_group_id string `json:"source_firewall_group_id,optional" copier:"source_firewall_group_id"` + source_ip_address string `json:"source_ip_address,optional" copier:"source_ip_address"` + source_port string `json:"source_port,optional" copier:"source_port"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + } +) + +type ( + DeleteFirewallRuleReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_rule_id string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` + } + DeleteFirewallRuleResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type ( + ListFirewallRulesReq{ + Platform string `json:"platform,optional" copier:"Platform"` + fields string `json:"fields,optional" copier:"fields"` + } + ListFirewallRulesResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + firewall_rules []Firewall_rules `json:"firewall_rules,optional" copier:"firewall_rules"` + } + Firewall_rules{ + action string `json:"action,optional" copier:"action"` + description string `json:"description,optional" copier:"description"` + destination_ip_address string `json:"destination_ip_address,optional" copier:"destination_ip_address"` + destination_firewall_group_id string `json:"destination_firewall_group_id,optional" copier:"destination_firewall_group_id"` + destination_port string `json:"destination_port,optional" copier:"destination_port"` + enabled bool `json:"enabled,optional" copier:"enabled"` + id string `json:"id,optional" copier:"id"` + ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + name string `json:"name,optional" copier:"name"` + project_id string `json:"project_id,optional" copier:"project_id"` + protocol string `json:"protocol,optional" copier:"protocol"` + shared bool `json:"shared,optional" copier:"shared"` + source_firewall_group_id string `json:"source_firewall_group_id,optional" copier:"source_firewall_group_id"` + source_ip_address string `json:"source_ip_address,optional" copier:"source_ip_address"` + source_port string `json:"source_port,optional" copier:"source_port"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + } +) + +type ( + ShowFirewallRuleDetailsReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_rule_id string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` + } + ShowFirewallRuleDetailsResp{ + firewall_rule Firewall_rule `json:"firewall_rule,optional" copier:"firewall_rule"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +//Security Group +type ( + ListSecurityGroupsReq{ + Platform string `json:"platform,optional" copier:"Platform"` + fields string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` + } + ListSecurityGroupsResp{ + security_groups Security_groups `json:"security_groups,optional" copier:"security_groups"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Security_groups { + id string `json:"id,optional" copier:"id"` + description string `json:"description,optional" copier:"description"` + name string `json:"name,optional" copier:"name"` + project_id string `json:"project_id,optional" copier:"project_id"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + tags []string `json:"tags,optional" copier:"tags"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + stateful bool `json:"stateful,optional" copier:"stateful"` + shared bool `json:"shared,optional" copier:"shared"` + } +) + +type ( + CreateSecurityGroupReq{ + Platform string `json:"platform,optional" copier:"Platform"` + firewall_rule_id string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` + } + CreateSecurityGroupResp{ + security_group Security_group `json:"security_group,optional" copier:"security_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } + Security_group{ + id string `json:"id,optional" copier:"id"` + description string `json:"description,optional" copier:"description"` + name string `json:"name,optional" copier:"name"` + project_id string `json:"project_id,optional" copier:"project_id"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + tags []string `json:"tags,optional" copier:"tags"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + stateful bool `json:"stateful,optional" copier:"stateful"` + shared bool `json:"shared,optional" copier:"shared"` + security_group_rules []Security_group_rules `json:"security_group_rules,optional" copier:"security_group_rules"` + } + Security_group_rules{ + direction string `json:"direction,optional" copier:"direction"` + ethertype string `json:"ethertype,optional" copier:"ethertype"` + id string `json:"id,optional" copier:"id"` + port_range_max int64 `json:"port_range_max,optional" copier:"port_range_max"` + port_range_min int64 `json:"port_range_min,optional" copier:"port_range_min"` + protocol string `json:"protocol,optional" copier:"protocol"` + remote_group_id string `json:"remote_group_id,optional" copier:"remote_group_id"` + remote_ip_prefix string `json:"remote_ip_prefix,optional" copier:"remote_ip_prefix"` + security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + project_id string `json:"project_id,optional" copier:"project_id"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + tags []string `json:"tags,optional" copier:"tags"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + stateful bool `json:"stateful,optional" copier:"stateful"` + belongs_to_default_sg bool `json:"belongs_to_default_sg,optional" copier:"belongs_to_default_sg"` + } +) + +type( + DeleteSecurityGroupReq{ + Platform string `json:"platform,optional" copier:"Platform"` + security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + } + DeleteSecurityGroupResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + } +) + +type( + UpdateSecurityGroupReq{ + Platform string `json:"platform,optional" copier:"Platform"` + security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + } + UpdateSecurityGroupResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + security_group Security_group `json:"security_group,optional" copier:"security_group"` + + } +) + +type( + ShowSecurityGroupReq{ + Platform string `json:"platform,optional" copier:"Platform"` + security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + fields string `json:"fields,optional" copier:"fields"` + verbose string `json:"verbose,optional" copier:"verbose"` + } + ShowSecurityGroupResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + security_group Security_group `json:"security_group,optional" copier:"security_group"` + } +) + +//SecurityGroupRules +type( + ListSecurityGroupRulesReq{ + Platform string `json:"platform,optional" copier:"Platform"` + } + ListSecurityGroupRulesResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + security_group_rules Security_group_rules `json:"security_group_rules,optional" copier:"security_group_rules"` + } +) + +type( + CreateSecurityGroupRuleReq{ + Platform string `json:"platform,optional" copier:"Platform"` + } + CreateSecurityGroupRuleResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + security_group_rule Security_group_rule `json:"security_group_rule,optional" copier:"security_group_rule"` + } + Security_group_rule{ + direction string `json:"direction,optional" copier:"direction"` + ethertype string `json:"ethertype,optional" copier:"ethertype"` + id string `json:"id,optional" copier:"id"` + port_range_max int64 `json:"port_range_max,optional" copier:"port_range_max"` + port_range_min int64 `json:"port_range_min,optional" copier:"port_range_min"` + protocol string `json:"protocol,optional" copier:"protocol"` + remote_group_id string `json:"remote_group_id,optional" copier:"remote_group_id"` + remote_ip_prefix string `json:"remote_ip_prefix,optional" copier:"remote_ip_prefix"` + security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + project_id string `json:"project_id,optional" copier:"project_id"` + created_at int64 `json:"created_at,optional" copier:"created_at"` + updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + tags []string `json:"tags,optional" copier:"tags"` + tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + stateful bool `json:"stateful,optional" copier:"stateful"` + belongs_to_default_sg bool `json:"belongs_to_default_sg,optional" copier:"belongs_to_default_sg"` + } +) + +type( + ShowSecurityGroupRuleReq{ + Platform string `json:"platform,optional" copier:"Platform"` + security_group_rule_id string `json:"security_group_rule_id,optional" copier:"security_group_rule_id"` + } + ShowSecurityGroupRuleResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + security_group_rule Security_group_rule `json:"security_group_rule,optional" copier:"security_group_rule"` + } +) + +type( + DeleteSecurityGroupRuleReq{ + Platform string `json:"platform,optional" copier:"Platform"` + security_group_rule_id string `json:"security_group_rule_id,optional" copier:"security_group_rule_id"` + } + DeleteSecurityGroupRuleResp{ + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + security_group_rule Security_group_rule `json:"security_group_rule,optional" copier:"security_group_rule"` + } +) + /******************find Networks end*************************/ /******************find ListVolumesDetail start*************************/ type ( ListVolumesDetailReq { - + Platform string `json:"platform,optional"` } ListVolumesDetailResp { VolumeDetail []VolumeDetail `json:"volumes" copier:"VolumeDetail"` @@ -668,6 +1910,7 @@ type ( VolumeId string `form:"volume_id" copier:"VolumeId"` Cascade bool `json:"cascade" copier:"Cascade"` Force bool `json:"force" copier:"force"` + Platform string `json:"platform,optional"` } DeleteVolumeResp { Code int32 `json:"code,omitempty" copier:"Code"` @@ -679,6 +1922,7 @@ type ( type ( CreateVolumeReq { Volume Volume `json:"volume" copier:"Volume"` + Platform string `json:"platform,optional"` } CreateVolumeResp { Volume VolumeResp `json:"volume" copier:"Volume"` @@ -717,7 +1961,7 @@ type ( ) type ( ListVolumeTypesReq { - + Platform string `json:"platform,optional"` } ListVolumeTypesResp { VolumeTypes []Volume_types `json:"volume_types" copier:"VolumeTypes"` @@ -743,6 +1987,7 @@ type( UpdateVolumeReq { Volume Volume `json:"volume" copier:"Volume"` VolumeId string `json:"volume_id" copier:"VolumeId"` + Platform string `json:"platform,optional"` } UpdateVolumeResp { Volume Volume `json:"volume" copier:"Volume"` @@ -755,6 +2000,7 @@ type( type( GetVolumeDetailedByIdReq { VolumeId string `form:"volume_id" copier:"VolumeId"` + Platform string `json:"platform,optional"` } GetVolumeDetailedByIdResp { Volume VolumeDetailed `json:"volume" copier:"Volume"` @@ -786,6 +2032,7 @@ type( type( CreateVolumeTypeReq { VolumeType VolumeType `json:"volume_type" copier:"VolumeType"` + Platform string `json:"platform,optional"` } CreateVolumeTypeResp { VolumeType VolumeType `json:"volume_type" copier:"VolumeType"` @@ -805,6 +2052,7 @@ type( type( DeleteVolumeTypeReq { VolumeTypeId string `json:"volume_type_id" copier:"VolumeTypeId"` + Platform string `json:"platform,optional"` } DeleteVolumeTypeResp { Code int32 `json:"code,omitempty" copier:"Code"` @@ -824,7 +2072,7 @@ type( CreatedAt string `json:"created_at" copier:"CreatedAt"` ConsumesQuota bool `json:"consumes_quota" copier:"ConsumesQuota"` UpdatedAt string `json:"updated_at" copier:"UpdatedAt"` - + Platform string `json:"platform,optional"` } ListVolumesResp { Volumes []VolumesList `json:"volumes" copier:"Volumes"` @@ -843,7 +2091,7 @@ type( type ( ListFlavorsDetailReq { - + Platform string `json:"platform,optional"` } ListFlavorsDetailResp { @@ -870,6 +2118,7 @@ type ( /******************Bare Metal start*************************/ type( ListNodesReq { + Platform string `json:"platform,optional"` Limit int64 `json:"limit" copier:"Limit"` Marker string `json:"marker" copier:"Marker"` SortDir string `json:"sort_dir" copier:"SortDir"` @@ -910,6 +2159,7 @@ type( ) type( CreateNodeReq { + Platform string `json:"platform,optional"` Name string `json:"name" copier:"Name"` Driver string `json:"driver" copier:"Driver"` DriverInfo DriverInfo `json:"driver_info" copier:"DriverInfo"` @@ -1061,6 +2311,7 @@ type( type( DeleteNodeReq{ + Platform string `json:"platform,optional"` NodeIdent string `json:"node_ident" copier:"NodeIdent"` } DeleteNodeResp{ @@ -1073,6 +2324,7 @@ type( ShowNodeDetailsReq{ NodeIdent string `json:"node_ident" copier:"NodeIdent"` Fields []Fields `json:"fields" copier:"Fields"` + Platform string `json:"platform,optional"` } Fields { diff --git a/api/internal/handler/routes.go b/api/internal/handler/routes.go index 0280f82d..7d2cb6a4 100644 --- a/api/internal/handler/routes.go +++ b/api/internal/handler/routes.go @@ -469,6 +469,66 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/vm/pauseServer", Handler: vm.PauseServerHandler(serverCtx), }, + { + Method: http.MethodPost, + Path: "/vm/UnpauseServer", + Handler: vm.UnpauseServerHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/ResizeServer", + Handler: vm.ResizeServerHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/MigrateServer", + Handler: vm.MigrateServerHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/ShelveServer", + Handler: vm.ShelveServerHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/ChangeAdministrativePassword", + Handler: vm.ChangeAdministrativePasswordHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/RescueServer", + Handler: vm.RescueServerHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/UnRescueServer", + Handler: vm.UnRescueHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/SuspendServer", + Handler: vm.SuspendServerHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/AddSecurityGroupToServer", + Handler: vm.AddSecurityGroupToServerHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/removeSecurityGroup", + Handler: vm.RemoveSecurityGroupHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/CreateFlavor", + Handler: vm.CreateFlavorHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/DeleteFlavor", + Handler: vm.DeleteFlavorHandler(serverCtx), + }, { Method: http.MethodGet, Path: "/vm/listImages", @@ -524,6 +584,231 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/vm/bulkCreateNetworks", Handler: vm.BulkCreateNetworksHandler(serverCtx), }, + { + Method: http.MethodGet, + Path: "/vm/listSubnets", + Handler: vm.ListSubnetsHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/deleteSubnet", + Handler: vm.DeleteSubnetHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/vm/updateSubnet", + Handler: vm.UpdateSubnetHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/listNetworkSegmentRanges", + Handler: vm.ListNetworkSegmentRangesRangeHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/createNetworkSegmentRange", + Handler: vm.CreateNetworkSegmentRangeHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/deleteNetworkSegmentRanges", + Handler: vm.DeleteNetworkSegmentRangesHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/vm/updateNetworkSegmentRanges", + Handler: vm.UpdateNetworkSegmentRangesHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/showNetworkSegmentRangeDetails", + Handler: vm.ShowNetworkSegmentRangeDetailsHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/createPort", + Handler: vm.CreatePortHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/listPortsReq", + Handler: vm.ListPortsHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/deletePort", + Handler: vm.DeletePortHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/vm/updatePort", + Handler: vm.UpdatePortHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/showPortDetails", + Handler: vm.ShowPortDetailsHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/createRouter", + Handler: vm.CreateRouterHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/listRouters", + Handler: vm.ListRoutersHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/deleteRouter", + Handler: vm.DeleteRouterHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/vm/updateRouter", + Handler: vm.UpdateRouterHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/showRouterDetails", + Handler: vm.ShowRouterDetailsHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/createFloatingIP", + Handler: vm.CreateFloatingIPHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ListFloatingIPs", + Handler: vm.ListFloatingIPsHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/deleteFloatingIP", + Handler: vm.DeleteFloatingIPHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/vm/updateFloatingIP", + Handler: vm.UpdateFloatingIPHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/showFloatingIPDetails", + Handler: vm.ShowFloatingIPDetailsHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/CreateFirewallGroup", + Handler: vm.CreateFirewallGroupHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ListFirewallGroups", + Handler: vm.ListFirewallGroupsHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/DeleteFirewallGroup", + Handler: vm.DeleteFirewallGroupHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/vm/UpdateFirewallGroup", + Handler: vm.UpdateFirewallGroupHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ShowFirewallGroupDetails", + Handler: vm.ShowFirewallGroupDetailsHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/CreateFirewallPolicy", + Handler: vm.CreateFirewallPolicyHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ListFirewallPolicies", + Handler: vm.ListFirewallPoliciesHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/DeleteFirewallPolicy", + Handler: vm.DeleteFirewallPolicyHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ShowFirewallRuleDetails", + Handler: vm.ShowFirewallRuleDetailsHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ShowFirewallPolicyDetails", + Handler: vm.ShowFirewallPolicyDetailsHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/CreateFirewallRule", + Handler: vm.CreateFirewallRuleHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ListFirewallRules", + Handler: vm.ListFirewallRulesHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/DeleteFirewallRule", + Handler: vm.DeleteFirewallRuleHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/CreateSecurityGroup", + Handler: vm.CreateSecurityGroupHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ListSecurityGroups", + Handler: vm.ListSecurityGroupsHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/DeleteSecurityGroup", + Handler: vm.DeleteSecurityGroupHandler(serverCtx), + }, + { + Method: http.MethodPut, + Path: "/vm/UpdateSecurityGroup", + Handler: vm.UpdateSecurityGroupHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ShowSecurityGroup", + Handler: vm.ShowSecurityGroupHandler(serverCtx), + }, + { + Method: http.MethodPost, + Path: "/vm/CreateSecurityGroupRule", + Handler: vm.CreateSecurityGroupRuleHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ListSecurityGroupRules", + Handler: vm.ListSecurityGroupRulesHandler(serverCtx), + }, + { + Method: http.MethodDelete, + Path: "/vm/DeleteSecurityGroupRule", + Handler: vm.DeleteSecurityGroupRuleHandler(serverCtx), + }, + { + Method: http.MethodGet, + Path: "/vm/ShowSecurityGroupRule", + Handler: vm.ShowSecurityGroupRuleHandler(serverCtx), + }, { Method: http.MethodGet, Path: "/vm/listVolumesDetail", diff --git a/api/internal/handler/vm/addsecuritygrouptoserverhandler.go b/api/internal/handler/vm/addsecuritygrouptoserverhandler.go new file mode 100644 index 00000000..86553cbf --- /dev/null +++ b/api/internal/handler/vm/addsecuritygrouptoserverhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func AddSecurityGroupToServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.AddSecurityGroupToServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewAddSecurityGroupToServerLogic(r.Context(), svcCtx) + resp, err := l.AddSecurityGroupToServer(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/changeadministrativepasswordhandler.go b/api/internal/handler/vm/changeadministrativepasswordhandler.go new file mode 100644 index 00000000..ecf1c6bc --- /dev/null +++ b/api/internal/handler/vm/changeadministrativepasswordhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ChangeAdministrativePasswordHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ChangeAdministrativePasswordReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewChangeAdministrativePasswordLogic(r.Context(), svcCtx) + resp, err := l.ChangeAdministrativePassword(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createfirewallgrouphandler.go b/api/internal/handler/vm/createfirewallgrouphandler.go new file mode 100644 index 00000000..f6f5b3a1 --- /dev/null +++ b/api/internal/handler/vm/createfirewallgrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateFirewallGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateFirewallGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateFirewallGroupLogic(r.Context(), svcCtx) + resp, err := l.CreateFirewallGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createfirewallpolicyhandler.go b/api/internal/handler/vm/createfirewallpolicyhandler.go new file mode 100644 index 00000000..77d8d1cf --- /dev/null +++ b/api/internal/handler/vm/createfirewallpolicyhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateFirewallPolicyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateFirewallPolicyReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateFirewallPolicyLogic(r.Context(), svcCtx) + resp, err := l.CreateFirewallPolicy(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createfirewallrulehandler.go b/api/internal/handler/vm/createfirewallrulehandler.go new file mode 100644 index 00000000..3995c08a --- /dev/null +++ b/api/internal/handler/vm/createfirewallrulehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateFirewallRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateFirewallRuleReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateFirewallRuleLogic(r.Context(), svcCtx) + resp, err := l.CreateFirewallRule(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createflavorhandler.go b/api/internal/handler/vm/createflavorhandler.go new file mode 100644 index 00000000..f32dc8f2 --- /dev/null +++ b/api/internal/handler/vm/createflavorhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateFlavorHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateFlavorReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateFlavorLogic(r.Context(), svcCtx) + resp, err := l.CreateFlavor(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createfloatingiphandler.go b/api/internal/handler/vm/createfloatingiphandler.go new file mode 100644 index 00000000..797a4a55 --- /dev/null +++ b/api/internal/handler/vm/createfloatingiphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateFloatingIPHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateFloatingIPReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateFloatingIPLogic(r.Context(), svcCtx) + resp, err := l.CreateFloatingIP(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createnetworksegmentrangehandler.go b/api/internal/handler/vm/createnetworksegmentrangehandler.go new file mode 100644 index 00000000..47f7e5fa --- /dev/null +++ b/api/internal/handler/vm/createnetworksegmentrangehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateNetworkSegmentRangeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateNetworkSegmentRangeReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateNetworkSegmentRangeLogic(r.Context(), svcCtx) + resp, err := l.CreateNetworkSegmentRange(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createporthandler.go b/api/internal/handler/vm/createporthandler.go new file mode 100644 index 00000000..0ea408b7 --- /dev/null +++ b/api/internal/handler/vm/createporthandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreatePortHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreatePortReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreatePortLogic(r.Context(), svcCtx) + resp, err := l.CreatePort(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createrouterhandler.go b/api/internal/handler/vm/createrouterhandler.go new file mode 100644 index 00000000..45390b39 --- /dev/null +++ b/api/internal/handler/vm/createrouterhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateRouterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateRouterReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateRouterLogic(r.Context(), svcCtx) + resp, err := l.CreateRouter(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createsecuritygrouphandler.go b/api/internal/handler/vm/createsecuritygrouphandler.go new file mode 100644 index 00000000..2fcfd935 --- /dev/null +++ b/api/internal/handler/vm/createsecuritygrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateSecurityGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateSecurityGroupLogic(r.Context(), svcCtx) + resp, err := l.CreateSecurityGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/createsecuritygrouprulehandler.go b/api/internal/handler/vm/createsecuritygrouprulehandler.go new file mode 100644 index 00000000..11ffe7ea --- /dev/null +++ b/api/internal/handler/vm/createsecuritygrouprulehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func CreateSecurityGroupRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.CreateSecurityGroupRuleReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewCreateSecurityGroupRuleLogic(r.Context(), svcCtx) + resp, err := l.CreateSecurityGroupRule(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletefirewallgrouphandler.go b/api/internal/handler/vm/deletefirewallgrouphandler.go new file mode 100644 index 00000000..240f1ceb --- /dev/null +++ b/api/internal/handler/vm/deletefirewallgrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteFirewallGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteFirewallGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteFirewallGroupLogic(r.Context(), svcCtx) + resp, err := l.DeleteFirewallGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletefirewallpolicyhandler.go b/api/internal/handler/vm/deletefirewallpolicyhandler.go new file mode 100644 index 00000000..ee0f12fa --- /dev/null +++ b/api/internal/handler/vm/deletefirewallpolicyhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteFirewallPolicyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteFirewallPolicyReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteFirewallPolicyLogic(r.Context(), svcCtx) + resp, err := l.DeleteFirewallPolicy(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletefirewallrulehandler.go b/api/internal/handler/vm/deletefirewallrulehandler.go new file mode 100644 index 00000000..44c60272 --- /dev/null +++ b/api/internal/handler/vm/deletefirewallrulehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteFirewallRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteFirewallRuleReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteFirewallRuleLogic(r.Context(), svcCtx) + resp, err := l.DeleteFirewallRule(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deleteflavorhandler.go b/api/internal/handler/vm/deleteflavorhandler.go new file mode 100644 index 00000000..7bf5fe04 --- /dev/null +++ b/api/internal/handler/vm/deleteflavorhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteFlavorHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteFlavorReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteFlavorLogic(r.Context(), svcCtx) + resp, err := l.DeleteFlavor(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletefloatingiphandler.go b/api/internal/handler/vm/deletefloatingiphandler.go new file mode 100644 index 00000000..3f7abdf3 --- /dev/null +++ b/api/internal/handler/vm/deletefloatingiphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteFloatingIPHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteFloatingIPReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteFloatingIPLogic(r.Context(), svcCtx) + resp, err := l.DeleteFloatingIP(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletenetworksegmentrangeshandler.go b/api/internal/handler/vm/deletenetworksegmentrangeshandler.go new file mode 100644 index 00000000..b4cfc237 --- /dev/null +++ b/api/internal/handler/vm/deletenetworksegmentrangeshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteNetworkSegmentRangesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteNetworkSegmentRangesReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteNetworkSegmentRangesLogic(r.Context(), svcCtx) + resp, err := l.DeleteNetworkSegmentRanges(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deleteporthandler.go b/api/internal/handler/vm/deleteporthandler.go new file mode 100644 index 00000000..45d4a17a --- /dev/null +++ b/api/internal/handler/vm/deleteporthandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeletePortHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeletePortReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeletePortLogic(r.Context(), svcCtx) + resp, err := l.DeletePort(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deleterouterhandler.go b/api/internal/handler/vm/deleterouterhandler.go new file mode 100644 index 00000000..0184dbed --- /dev/null +++ b/api/internal/handler/vm/deleterouterhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteRouterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteRouterReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteRouterLogic(r.Context(), svcCtx) + resp, err := l.DeleteRouter(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletesecuritygrouphandler.go b/api/internal/handler/vm/deletesecuritygrouphandler.go new file mode 100644 index 00000000..482ba147 --- /dev/null +++ b/api/internal/handler/vm/deletesecuritygrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteSecurityGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteSecurityGroupLogic(r.Context(), svcCtx) + resp, err := l.DeleteSecurityGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletesecuritygrouprulehandler.go b/api/internal/handler/vm/deletesecuritygrouprulehandler.go new file mode 100644 index 00000000..5dcf49cf --- /dev/null +++ b/api/internal/handler/vm/deletesecuritygrouprulehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteSecurityGroupRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteSecurityGroupRuleReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteSecurityGroupRuleLogic(r.Context(), svcCtx) + resp, err := l.DeleteSecurityGroupRule(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/deletesubnethandler.go b/api/internal/handler/vm/deletesubnethandler.go new file mode 100644 index 00000000..cb8e0b40 --- /dev/null +++ b/api/internal/handler/vm/deletesubnethandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func DeleteSubnetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.DeleteSubnetReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewDeleteSubnetLogic(r.Context(), svcCtx) + resp, err := l.DeleteSubnet(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listfirewallgroupshandler.go b/api/internal/handler/vm/listfirewallgroupshandler.go new file mode 100644 index 00000000..01041333 --- /dev/null +++ b/api/internal/handler/vm/listfirewallgroupshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListFirewallGroupsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListFirewallGroupsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListFirewallGroupsLogic(r.Context(), svcCtx) + resp, err := l.ListFirewallGroups(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listfirewallpolicieshandler.go b/api/internal/handler/vm/listfirewallpolicieshandler.go new file mode 100644 index 00000000..877c2806 --- /dev/null +++ b/api/internal/handler/vm/listfirewallpolicieshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListFirewallPoliciesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListFirewallPoliciesReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListFirewallPoliciesLogic(r.Context(), svcCtx) + resp, err := l.ListFirewallPolicies(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listfirewallruleshandler.go b/api/internal/handler/vm/listfirewallruleshandler.go new file mode 100644 index 00000000..b630593c --- /dev/null +++ b/api/internal/handler/vm/listfirewallruleshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListFirewallRulesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListFirewallRulesReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListFirewallRulesLogic(r.Context(), svcCtx) + resp, err := l.ListFirewallRules(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listfloatingipshandler.go b/api/internal/handler/vm/listfloatingipshandler.go new file mode 100644 index 00000000..f723634c --- /dev/null +++ b/api/internal/handler/vm/listfloatingipshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListFloatingIPsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListFloatingIPsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListFloatingIPsLogic(r.Context(), svcCtx) + resp, err := l.ListFloatingIPs(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listnetworksegmentrangesrangehandler.go b/api/internal/handler/vm/listnetworksegmentrangesrangehandler.go new file mode 100644 index 00000000..27b3478f --- /dev/null +++ b/api/internal/handler/vm/listnetworksegmentrangesrangehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListNetworkSegmentRangesRangeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListNetworkSegmentRangesReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListNetworkSegmentRangesRangeLogic(r.Context(), svcCtx) + resp, err := l.ListNetworkSegmentRangesRange(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listportshandler.go b/api/internal/handler/vm/listportshandler.go new file mode 100644 index 00000000..ac134170 --- /dev/null +++ b/api/internal/handler/vm/listportshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListPortsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListPortsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListPortsLogic(r.Context(), svcCtx) + resp, err := l.ListPorts(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listroutershandler.go b/api/internal/handler/vm/listroutershandler.go new file mode 100644 index 00000000..e7b6bc11 --- /dev/null +++ b/api/internal/handler/vm/listroutershandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListRoutersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListRoutersReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListRoutersLogic(r.Context(), svcCtx) + resp, err := l.ListRouters(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listsecuritygroupruleshandler.go b/api/internal/handler/vm/listsecuritygroupruleshandler.go new file mode 100644 index 00000000..2b31f7e8 --- /dev/null +++ b/api/internal/handler/vm/listsecuritygroupruleshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListSecurityGroupRulesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListSecurityGroupRulesReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListSecurityGroupRulesLogic(r.Context(), svcCtx) + resp, err := l.ListSecurityGroupRules(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listsecuritygroupshandler.go b/api/internal/handler/vm/listsecuritygroupshandler.go new file mode 100644 index 00000000..be559d8d --- /dev/null +++ b/api/internal/handler/vm/listsecuritygroupshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListSecurityGroupsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListSecurityGroupsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListSecurityGroupsLogic(r.Context(), svcCtx) + resp, err := l.ListSecurityGroups(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/listsubnetshandler.go b/api/internal/handler/vm/listsubnetshandler.go new file mode 100644 index 00000000..a148ccc5 --- /dev/null +++ b/api/internal/handler/vm/listsubnetshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ListSubnetsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ListSubnetsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewListSubnetsLogic(r.Context(), svcCtx) + resp, err := l.ListSubnets(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/migrateserverhandler.go b/api/internal/handler/vm/migrateserverhandler.go new file mode 100644 index 00000000..2a7dbe82 --- /dev/null +++ b/api/internal/handler/vm/migrateserverhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func MigrateServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.MigrateServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewMigrateServerLogic(r.Context(), svcCtx) + resp, err := l.MigrateServer(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/removesecuritygrouphandler.go b/api/internal/handler/vm/removesecuritygrouphandler.go new file mode 100644 index 00000000..40b21349 --- /dev/null +++ b/api/internal/handler/vm/removesecuritygrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func RemoveSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.RemoveSecurityGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewRemoveSecurityGroupLogic(r.Context(), svcCtx) + resp, err := l.RemoveSecurityGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/rescueserverhandler.go b/api/internal/handler/vm/rescueserverhandler.go new file mode 100644 index 00000000..97c18bd2 --- /dev/null +++ b/api/internal/handler/vm/rescueserverhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func RescueServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.RescueServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewRescueServerLogic(r.Context(), svcCtx) + resp, err := l.RescueServer(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/resizeserverhandler.go b/api/internal/handler/vm/resizeserverhandler.go new file mode 100644 index 00000000..81d8be1e --- /dev/null +++ b/api/internal/handler/vm/resizeserverhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ResizeServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ResizeServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewResizeServerLogic(r.Context(), svcCtx) + resp, err := l.ResizeServer(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/shelveserverhandler.go b/api/internal/handler/vm/shelveserverhandler.go new file mode 100644 index 00000000..927c78c3 --- /dev/null +++ b/api/internal/handler/vm/shelveserverhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShelveServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShelveServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShelveServerLogic(r.Context(), svcCtx) + resp, err := l.ShelveServer(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showfirewallgroupdetailshandler.go b/api/internal/handler/vm/showfirewallgroupdetailshandler.go new file mode 100644 index 00000000..6e1e07ae --- /dev/null +++ b/api/internal/handler/vm/showfirewallgroupdetailshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowFirewallGroupDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowFirewallGroupDetailsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowFirewallGroupDetailsLogic(r.Context(), svcCtx) + resp, err := l.ShowFirewallGroupDetails(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showfirewallpolicydetailshandler.go b/api/internal/handler/vm/showfirewallpolicydetailshandler.go new file mode 100644 index 00000000..1b562893 --- /dev/null +++ b/api/internal/handler/vm/showfirewallpolicydetailshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowFirewallPolicyDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowFirewallPolicyDetailsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowFirewallPolicyDetailsLogic(r.Context(), svcCtx) + resp, err := l.ShowFirewallPolicyDetails(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showfirewallruledetailshandler.go b/api/internal/handler/vm/showfirewallruledetailshandler.go new file mode 100644 index 00000000..b026c434 --- /dev/null +++ b/api/internal/handler/vm/showfirewallruledetailshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowFirewallRuleDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowFirewallRuleDetailsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowFirewallRuleDetailsLogic(r.Context(), svcCtx) + resp, err := l.ShowFirewallRuleDetails(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showfloatingipdetailshandler.go b/api/internal/handler/vm/showfloatingipdetailshandler.go new file mode 100644 index 00000000..91e09a44 --- /dev/null +++ b/api/internal/handler/vm/showfloatingipdetailshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowFloatingIPDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowFloatingIPDetailsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowFloatingIPDetailsLogic(r.Context(), svcCtx) + resp, err := l.ShowFloatingIPDetails(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/shownetworksegmentrangedetailshandler.go b/api/internal/handler/vm/shownetworksegmentrangedetailshandler.go new file mode 100644 index 00000000..309c7533 --- /dev/null +++ b/api/internal/handler/vm/shownetworksegmentrangedetailshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowNetworkSegmentRangeDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowNetworkSegmentRangeDetailsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowNetworkSegmentRangeDetailsLogic(r.Context(), svcCtx) + resp, err := l.ShowNetworkSegmentRangeDetails(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showportdetailshandler.go b/api/internal/handler/vm/showportdetailshandler.go new file mode 100644 index 00000000..2066679e --- /dev/null +++ b/api/internal/handler/vm/showportdetailshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowPortDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowPortDetailsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowPortDetailsLogic(r.Context(), svcCtx) + resp, err := l.ShowPortDetails(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showrouterdetailshandler.go b/api/internal/handler/vm/showrouterdetailshandler.go new file mode 100644 index 00000000..395e03d2 --- /dev/null +++ b/api/internal/handler/vm/showrouterdetailshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowRouterDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowRouterDetailsReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowRouterDetailsLogic(r.Context(), svcCtx) + resp, err := l.ShowRouterDetails(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showsecuritygrouphandler.go b/api/internal/handler/vm/showsecuritygrouphandler.go new file mode 100644 index 00000000..0cf2ecfa --- /dev/null +++ b/api/internal/handler/vm/showsecuritygrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowSecurityGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowSecurityGroupLogic(r.Context(), svcCtx) + resp, err := l.ShowSecurityGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/showsecuritygrouprulehandler.go b/api/internal/handler/vm/showsecuritygrouprulehandler.go new file mode 100644 index 00000000..3dcdc0ed --- /dev/null +++ b/api/internal/handler/vm/showsecuritygrouprulehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func ShowSecurityGroupRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.ShowSecurityGroupRuleReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewShowSecurityGroupRuleLogic(r.Context(), svcCtx) + resp, err := l.ShowSecurityGroupRule(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/suspendserverhandler.go b/api/internal/handler/vm/suspendserverhandler.go new file mode 100644 index 00000000..fd9826e8 --- /dev/null +++ b/api/internal/handler/vm/suspendserverhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func SuspendServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.SuspendServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewSuspendServerLogic(r.Context(), svcCtx) + resp, err := l.SuspendServer(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/unpauseserverhandler.go b/api/internal/handler/vm/unpauseserverhandler.go new file mode 100644 index 00000000..3095d1e8 --- /dev/null +++ b/api/internal/handler/vm/unpauseserverhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UnpauseServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UnpauseServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUnpauseServerLogic(r.Context(), svcCtx) + resp, err := l.UnpauseServer(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/unrescuehandler.go b/api/internal/handler/vm/unrescuehandler.go new file mode 100644 index 00000000..e07adec8 --- /dev/null +++ b/api/internal/handler/vm/unrescuehandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UnRescueHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UnRescueServerReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUnRescueLogic(r.Context(), svcCtx) + resp, err := l.UnRescue(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/updatefirewallgrouphandler.go b/api/internal/handler/vm/updatefirewallgrouphandler.go new file mode 100644 index 00000000..1d072d0b --- /dev/null +++ b/api/internal/handler/vm/updatefirewallgrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UpdateFirewallGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateFirewallGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUpdateFirewallGroupLogic(r.Context(), svcCtx) + resp, err := l.UpdateFirewallGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/updatefloatingiphandler.go b/api/internal/handler/vm/updatefloatingiphandler.go new file mode 100644 index 00000000..16493a84 --- /dev/null +++ b/api/internal/handler/vm/updatefloatingiphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UpdateFloatingIPHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateFloatingIPReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUpdateFloatingIPLogic(r.Context(), svcCtx) + resp, err := l.UpdateFloatingIP(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/updatenetworksegmentrangeshandler.go b/api/internal/handler/vm/updatenetworksegmentrangeshandler.go new file mode 100644 index 00000000..c91e38eb --- /dev/null +++ b/api/internal/handler/vm/updatenetworksegmentrangeshandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UpdateNetworkSegmentRangesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateNetworkSegmentRangesReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUpdateNetworkSegmentRangesLogic(r.Context(), svcCtx) + resp, err := l.UpdateNetworkSegmentRanges(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/updateporthandler.go b/api/internal/handler/vm/updateporthandler.go new file mode 100644 index 00000000..37e34376 --- /dev/null +++ b/api/internal/handler/vm/updateporthandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UpdatePortHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdatePortReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUpdatePortLogic(r.Context(), svcCtx) + resp, err := l.UpdatePort(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/updaterouterhandler.go b/api/internal/handler/vm/updaterouterhandler.go new file mode 100644 index 00000000..262ee32a --- /dev/null +++ b/api/internal/handler/vm/updaterouterhandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UpdateRouterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateRouterReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUpdateRouterLogic(r.Context(), svcCtx) + resp, err := l.UpdateRouter(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/updatesecuritygrouphandler.go b/api/internal/handler/vm/updatesecuritygrouphandler.go new file mode 100644 index 00000000..2d0d5de2 --- /dev/null +++ b/api/internal/handler/vm/updatesecuritygrouphandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UpdateSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateSecurityGroupReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUpdateSecurityGroupLogic(r.Context(), svcCtx) + resp, err := l.UpdateSecurityGroup(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/handler/vm/updatesubnethandler.go b/api/internal/handler/vm/updatesubnethandler.go new file mode 100644 index 00000000..a8093754 --- /dev/null +++ b/api/internal/handler/vm/updatesubnethandler.go @@ -0,0 +1,28 @@ +package vm + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" +) + +func UpdateSubnetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.UpdateSubnetReq + if err := httpx.Parse(r, &req); err != nil { + httpx.ErrorCtx(r.Context(), w, err) + return + } + + l := vm.NewUpdateSubnetLogic(r.Context(), svcCtx) + resp, err := l.UpdateSubnet(&req) + if err != nil { + httpx.ErrorCtx(r.Context(), w, err) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } + } +} diff --git a/api/internal/logic/vm/addsecuritygrouptoserverlogic.go b/api/internal/logic/vm/addsecuritygrouptoserverlogic.go new file mode 100644 index 00000000..6723703f --- /dev/null +++ b/api/internal/logic/vm/addsecuritygrouptoserverlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type AddSecurityGroupToServerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewAddSecurityGroupToServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddSecurityGroupToServerLogic { + return &AddSecurityGroupToServerLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *AddSecurityGroupToServerLogic) AddSecurityGroupToServer(req *types.AddSecurityGroupToServerReq) (resp *types.AddSecurityGroupToServerResp, err error) { + // todo: add your logic here and delete this line + AddSecurityGroupToServerReq := &openstack.AddSecurityGroupToServerReq{} + err = copier.CopyWithOption(AddSecurityGroupToServerReq, req, copier.Option{Converters: utils.Converters}) + AddSecurityGroupToServerResp, err := l.svcCtx.OpenstackRpc.AddSecurityGroupToServer(l.ctx, AddSecurityGroupToServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&AddSecurityGroupToServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &AddSecurityGroupToServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/changeadministrativepasswordlogic.go b/api/internal/logic/vm/changeadministrativepasswordlogic.go new file mode 100644 index 00000000..a87dba17 --- /dev/null +++ b/api/internal/logic/vm/changeadministrativepasswordlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ChangeAdministrativePasswordLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewChangeAdministrativePasswordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ChangeAdministrativePasswordLogic { + return &ChangeAdministrativePasswordLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ChangeAdministrativePasswordLogic) ChangeAdministrativePassword(req *types.ChangeAdministrativePasswordReq) (resp *types.ChangeAdministrativePasswordResp, err error) { + // todo: add your logic here and delete this line + ChangeAdministrativePasswordReq := &openstack.ChangeAdministrativePasswordReq{} + err = copier.CopyWithOption(ChangeAdministrativePasswordReq, req, copier.Option{Converters: utils.Converters}) + ChangeAdministrativePasswordResp, err := l.svcCtx.OpenstackRpc.ChangeAdministrativePassword(l.ctx, ChangeAdministrativePasswordReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ChangeAdministrativePasswordResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ChangeAdministrativePasswordResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createfirewallgrouplogic.go b/api/internal/logic/vm/createfirewallgrouplogic.go new file mode 100644 index 00000000..1a4fafa0 --- /dev/null +++ b/api/internal/logic/vm/createfirewallgrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateFirewallGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateFirewallGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateFirewallGroupLogic { + return &CreateFirewallGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateFirewallGroupLogic) CreateFirewallGroup(req *types.CreateFirewallGroupReq) (resp *types.CreateFirewallGroupResp, err error) { + // todo: add your logic here and delete this line + CreateFirewallGroupReq := &openstack.CreateFirewallGroupReq{} + err = copier.CopyWithOption(CreateFirewallGroupReq, req, copier.Option{Converters: utils.Converters}) + CreateFirewallGroupResp, err := l.svcCtx.OpenstackRpc.CreateFirewallGroup(l.ctx, CreateFirewallGroupReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateFirewallGroupResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateFirewallGroupResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createfirewallpolicylogic.go b/api/internal/logic/vm/createfirewallpolicylogic.go new file mode 100644 index 00000000..ea58bfdd --- /dev/null +++ b/api/internal/logic/vm/createfirewallpolicylogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateFirewallPolicyLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateFirewallPolicyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateFirewallPolicyLogic { + return &CreateFirewallPolicyLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateFirewallPolicyLogic) CreateFirewallPolicy(req *types.CreateFirewallPolicyReq) (resp *types.CreateFirewallPolicyResp, err error) { + // todo: add your logic here and delete this line + CreateFirewallPolicyReq := &openstack.CreateFirewallPolicyReq{} + err = copier.CopyWithOption(CreateFirewallPolicyReq, req, copier.Option{Converters: utils.Converters}) + CreateFirewallPolicyResp, err := l.svcCtx.OpenstackRpc.CreateFirewallPolicy(l.ctx, CreateFirewallPolicyReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateFirewallPolicyResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateFirewallPolicyResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createfirewallrulelogic.go b/api/internal/logic/vm/createfirewallrulelogic.go new file mode 100644 index 00000000..2ecf318a --- /dev/null +++ b/api/internal/logic/vm/createfirewallrulelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateFirewallRuleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateFirewallRuleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateFirewallRuleLogic { + return &CreateFirewallRuleLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateFirewallRuleLogic) CreateFirewallRule(req *types.CreateFirewallRuleReq) (resp *types.CreateFirewallRuleResp, err error) { + // todo: add your logic here and delete this line + CreateFirewallRuleReq := &openstack.CreateFirewallRuleReq{} + err = copier.CopyWithOption(CreateFirewallRuleReq, req, copier.Option{Converters: utils.Converters}) + CreateFirewallRuleResp, err := l.svcCtx.OpenstackRpc.CreateFirewallRule(l.ctx, CreateFirewallRuleReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateFirewallRuleResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateFirewallRuleResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createflavorlogic.go b/api/internal/logic/vm/createflavorlogic.go new file mode 100644 index 00000000..3d414ed0 --- /dev/null +++ b/api/internal/logic/vm/createflavorlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateFlavorLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateFlavorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateFlavorLogic { + return &CreateFlavorLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateFlavorLogic) CreateFlavor(req *types.CreateFlavorReq) (resp *types.CreateFlavorResp, err error) { + // todo: add your logic here and delete this line + CreateFlavorReq := &openstack.CreateFlavorReq{} + err = copier.CopyWithOption(CreateFlavorReq, req, copier.Option{Converters: utils.Converters}) + CreateFlavorResp, err := l.svcCtx.OpenstackRpc.CreateFlavor(l.ctx, CreateFlavorReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateFlavorResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateFlavorResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createfloatingiplogic.go b/api/internal/logic/vm/createfloatingiplogic.go new file mode 100644 index 00000000..de300dc8 --- /dev/null +++ b/api/internal/logic/vm/createfloatingiplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateFloatingIPLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateFloatingIPLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateFloatingIPLogic { + return &CreateFloatingIPLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateFloatingIPLogic) CreateFloatingIP(req *types.CreateFloatingIPReq) (resp *types.CreateFloatingIPResp, err error) { + // todo: add your logic here and delete this line + CreateFloatingIPReq := &openstack.CreateFloatingIPReq{} + err = copier.CopyWithOption(CreateFloatingIPReq, req, copier.Option{Converters: utils.Converters}) + CreateFloatingIPResp, err := l.svcCtx.OpenstackRpc.CreateFloatingIP(l.ctx, CreateFloatingIPReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateFloatingIPResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateFloatingIPResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createnetworksegmentrangelogic.go b/api/internal/logic/vm/createnetworksegmentrangelogic.go new file mode 100644 index 00000000..b9ae3b57 --- /dev/null +++ b/api/internal/logic/vm/createnetworksegmentrangelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateNetworkSegmentRangeLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateNetworkSegmentRangeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateNetworkSegmentRangeLogic { + return &CreateNetworkSegmentRangeLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateNetworkSegmentRangeLogic) CreateNetworkSegmentRange(req *types.CreateNetworkSegmentRangeReq) (resp *types.CreateNetworkSegmentRangeResp, err error) { + // todo: add your logic here and delete this line + CreateNetworkSegmentRangeReq := &openstack.CreateNetworkSegmentRangeReq{} + err = copier.CopyWithOption(CreateNetworkSegmentRangeReq, req, copier.Option{Converters: utils.Converters}) + CreateNetworkSegmentRangeResp, err := l.svcCtx.OpenstackRpc.CreateNetworkSegmentRange(l.ctx, CreateNetworkSegmentRangeReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateNetworkSegmentRangeResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateNetworkSegmentRangeResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createportlogic.go b/api/internal/logic/vm/createportlogic.go new file mode 100644 index 00000000..c305da4e --- /dev/null +++ b/api/internal/logic/vm/createportlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreatePortLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreatePortLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreatePortLogic { + return &CreatePortLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreatePortLogic) CreatePort(req *types.CreatePortReq) (resp *types.CreatePortResp, err error) { + // todo: add your logic here and delete this line + CreatePortReq := &openstack.CreatePortReq{} + err = copier.CopyWithOption(CreatePortReq, req, copier.Option{Converters: utils.Converters}) + CreatePortResp, err := l.svcCtx.OpenstackRpc.CreatePort(l.ctx, CreatePortReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreatePortResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreatePortResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createrouterlogic.go b/api/internal/logic/vm/createrouterlogic.go new file mode 100644 index 00000000..aa325a63 --- /dev/null +++ b/api/internal/logic/vm/createrouterlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateRouterLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateRouterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateRouterLogic { + return &CreateRouterLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateRouterLogic) CreateRouter(req *types.CreateRouterReq) (resp *types.CreateRouterResp, err error) { + // todo: add your logic here and delete this line + CreateRouterReq := &openstack.CreateRouterReq{} + err = copier.CopyWithOption(CreateRouterReq, req, copier.Option{Converters: utils.Converters}) + CreateRouterResp, err := l.svcCtx.OpenstackRpc.CreateRouter(l.ctx, CreateRouterReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateRouterResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateRouterResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createsecuritygrouplogic.go b/api/internal/logic/vm/createsecuritygrouplogic.go new file mode 100644 index 00000000..ae512392 --- /dev/null +++ b/api/internal/logic/vm/createsecuritygrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateSecurityGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateSecurityGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateSecurityGroupLogic { + return &CreateSecurityGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateSecurityGroupLogic) CreateSecurityGroup(req *types.CreateSecurityGroupReq) (resp *types.CreateSecurityGroupResp, err error) { + // todo: add your logic here and delete this line + CreateSecurityGroupReq := &openstack.CreateSecurityGroupReq{} + err = copier.CopyWithOption(CreateSecurityGroupReq, req, copier.Option{Converters: utils.Converters}) + CreateSecurityGroupResp, err := l.svcCtx.OpenstackRpc.CreateSecurityGroup(l.ctx, CreateSecurityGroupReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateSecurityGroupResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateSecurityGroupResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/createsecuritygrouprulelogic.go b/api/internal/logic/vm/createsecuritygrouprulelogic.go new file mode 100644 index 00000000..00b18cf0 --- /dev/null +++ b/api/internal/logic/vm/createsecuritygrouprulelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateSecurityGroupRuleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateSecurityGroupRuleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateSecurityGroupRuleLogic { + return &CreateSecurityGroupRuleLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *CreateSecurityGroupRuleLogic) CreateSecurityGroupRule(req *types.CreateSecurityGroupRuleReq) (resp *types.CreateSecurityGroupRuleResp, err error) { + // todo: add your logic here and delete this line + CreateSecurityGroupRuleReq := &openstack.CreateSecurityGroupRuleReq{} + err = copier.CopyWithOption(CreateSecurityGroupRuleReq, req, copier.Option{Converters: utils.Converters}) + CreateSecurityGroupRuleResp, err := l.svcCtx.OpenstackRpc.CreateSecurityGroupRule(l.ctx, CreateSecurityGroupRuleReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateSecurityGroupRuleResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateSecurityGroupRuleResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletefirewallgrouplogic.go b/api/internal/logic/vm/deletefirewallgrouplogic.go new file mode 100644 index 00000000..ca0d6637 --- /dev/null +++ b/api/internal/logic/vm/deletefirewallgrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteFirewallGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteFirewallGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteFirewallGroupLogic { + return &DeleteFirewallGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteFirewallGroupLogic) DeleteFirewallGroup(req *types.DeleteFirewallGroupReq) (resp *types.DeleteFirewallGroupResp, err error) { + // todo: add your logic here and delete this line + DeleteFirewallGroupReq := &openstack.DeleteFirewallGroupReq{} + err = copier.CopyWithOption(DeleteFirewallGroupReq, req, copier.Option{Converters: utils.Converters}) + DeleteFirewallGroupResp, err := l.svcCtx.OpenstackRpc.DeleteFirewallGroup(l.ctx, DeleteFirewallGroupReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteFirewallGroupResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteFirewallGroupResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletefirewallpolicylogic.go b/api/internal/logic/vm/deletefirewallpolicylogic.go new file mode 100644 index 00000000..4fd40561 --- /dev/null +++ b/api/internal/logic/vm/deletefirewallpolicylogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteFirewallPolicyLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteFirewallPolicyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteFirewallPolicyLogic { + return &DeleteFirewallPolicyLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteFirewallPolicyLogic) DeleteFirewallPolicy(req *types.DeleteFirewallPolicyReq) (resp *types.DeleteFirewallPolicyResp, err error) { + // todo: add your logic here and delete this line + DeleteFirewallPolicyReq := &openstack.DeleteFirewallPolicyReq{} + err = copier.CopyWithOption(DeleteFirewallPolicyReq, req, copier.Option{Converters: utils.Converters}) + DeleteFirewallPolicyResp, err := l.svcCtx.OpenstackRpc.DeleteFirewallPolicy(l.ctx, DeleteFirewallPolicyReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteFirewallPolicyResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteFirewallPolicyResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletefirewallrulelogic.go b/api/internal/logic/vm/deletefirewallrulelogic.go new file mode 100644 index 00000000..5fd81587 --- /dev/null +++ b/api/internal/logic/vm/deletefirewallrulelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteFirewallRuleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteFirewallRuleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteFirewallRuleLogic { + return &DeleteFirewallRuleLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteFirewallRuleLogic) DeleteFirewallRule(req *types.DeleteFirewallRuleReq) (resp *types.DeleteFirewallRuleResp, err error) { + // todo: add your logic here and delete this line + DeleteFirewallRuleReq := &openstack.DeleteFirewallPolicyReq{} + err = copier.CopyWithOption(DeleteFirewallRuleReq, req, copier.Option{Converters: utils.Converters}) + DeleteFirewallRuleResp, err := l.svcCtx.OpenstackRpc.DeleteFirewallPolicy(l.ctx, DeleteFirewallRuleReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteFirewallRuleResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteFirewallRuleResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deleteflavorlogic.go b/api/internal/logic/vm/deleteflavorlogic.go new file mode 100644 index 00000000..c4e66fa8 --- /dev/null +++ b/api/internal/logic/vm/deleteflavorlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteFlavorLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteFlavorLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteFlavorLogic { + return &DeleteFlavorLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteFlavorLogic) DeleteFlavor(req *types.DeleteFlavorReq) (resp *types.DeleteFlavorResp, err error) { + // todo: add your logic here and delete this line + DeleteFlavorReq := &openstack.DeleteFlavorReq{} + err = copier.CopyWithOption(DeleteFlavorReq, req, copier.Option{Converters: utils.Converters}) + DeleteFlavorResp, err := l.svcCtx.OpenstackRpc.DeleteFlavor(l.ctx, DeleteFlavorReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteFlavorResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteFlavorResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletefloatingiplogic.go b/api/internal/logic/vm/deletefloatingiplogic.go new file mode 100644 index 00000000..e0355b66 --- /dev/null +++ b/api/internal/logic/vm/deletefloatingiplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteFloatingIPLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteFloatingIPLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteFloatingIPLogic { + return &DeleteFloatingIPLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteFloatingIPLogic) DeleteFloatingIP(req *types.DeleteFloatingIPReq) (resp *types.DeleteFloatingIPResp, err error) { + // todo: add your logic here and delete this line + DeleteFloatingIPReq := &openstack.DeleteFloatingIPReq{} + err = copier.CopyWithOption(DeleteFloatingIPReq, req, copier.Option{Converters: utils.Converters}) + DeleteFloatingIPResp, err := l.svcCtx.OpenstackRpc.DeleteFloatingIP(l.ctx, DeleteFloatingIPReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteFloatingIPResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteFloatingIPResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletenetworksegmentrangeslogic.go b/api/internal/logic/vm/deletenetworksegmentrangeslogic.go new file mode 100644 index 00000000..2a533b07 --- /dev/null +++ b/api/internal/logic/vm/deletenetworksegmentrangeslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteNetworkSegmentRangesLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteNetworkSegmentRangesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteNetworkSegmentRangesLogic { + return &DeleteNetworkSegmentRangesLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteNetworkSegmentRangesLogic) DeleteNetworkSegmentRanges(req *types.DeleteNetworkSegmentRangesReq) (resp *types.DeleteNetworkSegmentRangesResp, err error) { + // todo: add your logic here and delete this line + DeleteNetworkSegmentRangesReq := &openstack.DeleteNetworkSegmentRangesReq{} + err = copier.CopyWithOption(DeleteNetworkSegmentRangesReq, req, copier.Option{Converters: utils.Converters}) + DeleteNetworkSegmentRangesResp, err := l.svcCtx.OpenstackRpc.DeleteNetworkSegmentRanges(l.ctx, DeleteNetworkSegmentRangesReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteNetworkSegmentRangesResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteNetworkSegmentRangesResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deleteportlogic.go b/api/internal/logic/vm/deleteportlogic.go new file mode 100644 index 00000000..892440f1 --- /dev/null +++ b/api/internal/logic/vm/deleteportlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeletePortLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeletePortLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeletePortLogic { + return &DeletePortLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeletePortLogic) DeletePort(req *types.DeletePortReq) (resp *types.DeletePortResp, err error) { + // todo: add your logic here and delete this line + DeletePortReq := &openstack.DeletePortReq{} + err = copier.CopyWithOption(DeletePortReq, req, copier.Option{Converters: utils.Converters}) + DeletePortResp, err := l.svcCtx.OpenstackRpc.DeletePort(l.ctx, DeletePortReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeletePortResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeletePortResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deleterouterlogic.go b/api/internal/logic/vm/deleterouterlogic.go new file mode 100644 index 00000000..7e39dfdb --- /dev/null +++ b/api/internal/logic/vm/deleterouterlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteRouterLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteRouterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteRouterLogic { + return &DeleteRouterLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteRouterLogic) DeleteRouter(req *types.DeleteRouterReq) (resp *types.DeleteRouterResp, err error) { + // todo: add your logic here and delete this line + DeleteRouterReq := &openstack.DeleteRouterReq{} + err = copier.CopyWithOption(DeleteRouterReq, req, copier.Option{Converters: utils.Converters}) + DeleteRouterResp, err := l.svcCtx.OpenstackRpc.DeleteRouter(l.ctx, DeleteRouterReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteRouterResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteRouterResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletesecuritygrouplogic.go b/api/internal/logic/vm/deletesecuritygrouplogic.go new file mode 100644 index 00000000..a5f72343 --- /dev/null +++ b/api/internal/logic/vm/deletesecuritygrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteSecurityGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteSecurityGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSecurityGroupLogic { + return &DeleteSecurityGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteSecurityGroupLogic) DeleteSecurityGroup(req *types.DeleteSecurityGroupReq) (resp *types.DeleteSecurityGroupResp, err error) { + // todo: add your logic here and delete this line + DeleteSecurityGroupReq := &openstack.DeleteSecurityGroupReq{} + err = copier.CopyWithOption(DeleteSecurityGroupReq, req, copier.Option{Converters: utils.Converters}) + DeleteSecurityGroupResp, err := l.svcCtx.OpenstackRpc.DeleteSecurityGroup(l.ctx, DeleteSecurityGroupReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteSecurityGroupResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteSecurityGroupResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletesecuritygrouprulelogic.go b/api/internal/logic/vm/deletesecuritygrouprulelogic.go new file mode 100644 index 00000000..369be8d1 --- /dev/null +++ b/api/internal/logic/vm/deletesecuritygrouprulelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteSecurityGroupRuleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteSecurityGroupRuleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSecurityGroupRuleLogic { + return &DeleteSecurityGroupRuleLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteSecurityGroupRuleLogic) DeleteSecurityGroupRule(req *types.DeleteSecurityGroupRuleReq) (resp *types.DeleteSecurityGroupRuleResp, err error) { + // todo: add your logic here and delete this line + DeleteSecurityGroupRuleReq := &openstack.DeleteSecurityGroupRuleReq{} + err = copier.CopyWithOption(DeleteSecurityGroupRuleReq, req, copier.Option{Converters: utils.Converters}) + DeleteSecurityGroupRuleResp, err := l.svcCtx.OpenstackRpc.DeleteSecurityGroupRule(l.ctx, DeleteSecurityGroupRuleReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteSecurityGroupRuleResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteSecurityGroupRuleResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/deletesubnetlogic.go b/api/internal/logic/vm/deletesubnetlogic.go new file mode 100644 index 00000000..794537cb --- /dev/null +++ b/api/internal/logic/vm/deletesubnetlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteSubnetLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteSubnetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSubnetLogic { + return &DeleteSubnetLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *DeleteSubnetLogic) DeleteSubnet(req *types.DeleteSubnetReq) (resp *types.DeleteSubnetResp, err error) { + // todo: add your logic here and delete this line + DeleteSubnetReq := &openstack.DeleteSubnetReq{} + err = copier.CopyWithOption(DeleteSubnetReq, req, copier.Option{Converters: utils.Converters}) + DeleteSubnetResp, err := l.svcCtx.OpenstackRpc.DeleteSubnet(l.ctx, DeleteSubnetReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&DeleteSubnetResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &DeleteSubnetResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listfirewallgroupslogic.go b/api/internal/logic/vm/listfirewallgroupslogic.go new file mode 100644 index 00000000..ae8676e7 --- /dev/null +++ b/api/internal/logic/vm/listfirewallgroupslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListFirewallGroupsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListFirewallGroupsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListFirewallGroupsLogic { + return &ListFirewallGroupsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListFirewallGroupsLogic) ListFirewallGroups(req *types.ListFirewallGroupsReq) (resp *types.ListFirewallGroupsResp, err error) { + // todo: add your logic here and delete this line + ListFirewallGroupsReq := &openstack.ListFirewallGroupsReq{} + err = copier.CopyWithOption(ListFirewallGroupsReq, req, copier.Option{Converters: utils.Converters}) + ListFirewallGroupsResp, err := l.svcCtx.OpenstackRpc.ListFirewallGroups(l.ctx, ListFirewallGroupsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListFirewallGroupsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListFirewallGroupsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listfirewallpolicieslogic.go b/api/internal/logic/vm/listfirewallpolicieslogic.go new file mode 100644 index 00000000..9a716b56 --- /dev/null +++ b/api/internal/logic/vm/listfirewallpolicieslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListFirewallPoliciesLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListFirewallPoliciesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListFirewallPoliciesLogic { + return &ListFirewallPoliciesLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListFirewallPoliciesLogic) ListFirewallPolicies(req *types.ListFirewallPoliciesReq) (resp *types.ListFirewallPoliciesResp, err error) { + // todo: add your logic here and delete this line + ListFirewallPoliciesReq := &openstack.ListFirewallPoliciesReq{} + err = copier.CopyWithOption(ListFirewallPoliciesReq, req, copier.Option{Converters: utils.Converters}) + ListFirewallPoliciesResp, err := l.svcCtx.OpenstackRpc.ListFirewallPolicies(l.ctx, ListFirewallPoliciesReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListFirewallPoliciesResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListFirewallPoliciesResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listfirewallruleslogic.go b/api/internal/logic/vm/listfirewallruleslogic.go new file mode 100644 index 00000000..de2c5fd1 --- /dev/null +++ b/api/internal/logic/vm/listfirewallruleslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListFirewallRulesLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListFirewallRulesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListFirewallRulesLogic { + return &ListFirewallRulesLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListFirewallRulesLogic) ListFirewallRules(req *types.ListFirewallRulesReq) (resp *types.ListFirewallRulesResp, err error) { + // todo: add your logic here and delete this line + ListFirewallRulesReq := &openstack.ListFirewallRulesReq{} + err = copier.CopyWithOption(ListFirewallRulesReq, req, copier.Option{Converters: utils.Converters}) + ListFirewallRulesResp, err := l.svcCtx.OpenstackRpc.ListFirewallRules(l.ctx, ListFirewallRulesReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListFirewallRulesResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListFirewallRulesResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listfloatingipslogic.go b/api/internal/logic/vm/listfloatingipslogic.go new file mode 100644 index 00000000..c3dea113 --- /dev/null +++ b/api/internal/logic/vm/listfloatingipslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListFloatingIPsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListFloatingIPsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListFloatingIPsLogic { + return &ListFloatingIPsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListFloatingIPsLogic) ListFloatingIPs(req *types.ListFloatingIPsReq) (resp *types.ListFloatingIPsResp, err error) { + // todo: add your logic here and delete this line + ListFloatingIPsReq := &openstack.ListFloatingIPsReq{} + err = copier.CopyWithOption(ListFloatingIPsReq, req, copier.Option{Converters: utils.Converters}) + ListFloatingIPsResp, err := l.svcCtx.OpenstackRpc.ListFloatingIPs(l.ctx, ListFloatingIPsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListFloatingIPsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListFloatingIPsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listnetworksegmentrangesrangelogic.go b/api/internal/logic/vm/listnetworksegmentrangesrangelogic.go new file mode 100644 index 00000000..263659a4 --- /dev/null +++ b/api/internal/logic/vm/listnetworksegmentrangesrangelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListNetworkSegmentRangesRangeLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListNetworkSegmentRangesRangeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListNetworkSegmentRangesRangeLogic { + return &ListNetworkSegmentRangesRangeLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListNetworkSegmentRangesRangeLogic) ListNetworkSegmentRangesRange(req *types.ListNetworkSegmentRangesReq) (resp *types.ListNetworkSegmentRangesResp, err error) { + // todo: add your logic here and delete this line + ListNetworkSegmentRangesReq := &openstack.ListNetworkSegmentRangesReq{} + err = copier.CopyWithOption(ListNetworkSegmentRangesReq, req, copier.Option{Converters: utils.Converters}) + ListNetworkSegmentRangesResp, err := l.svcCtx.OpenstackRpc.ListNetworkSegmentRanges(l.ctx, ListNetworkSegmentRangesReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListNetworkSegmentRangesResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListNetworkSegmentRangesResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listportslogic.go b/api/internal/logic/vm/listportslogic.go new file mode 100644 index 00000000..91f28123 --- /dev/null +++ b/api/internal/logic/vm/listportslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListPortsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListPortsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListPortsLogic { + return &ListPortsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListPortsLogic) ListPorts(req *types.ListPortsReq) (resp *types.ListPortsResp, err error) { + // todo: add your logic here and delete this line + ListPortsReq := &openstack.ListPortsReq{} + err = copier.CopyWithOption(ListPortsReq, req, copier.Option{Converters: utils.Converters}) + ListPortsResp, err := l.svcCtx.OpenstackRpc.ListPorts(l.ctx, ListPortsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListPortsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListPortsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listrouterslogic.go b/api/internal/logic/vm/listrouterslogic.go new file mode 100644 index 00000000..66a74a40 --- /dev/null +++ b/api/internal/logic/vm/listrouterslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListRoutersLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListRoutersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListRoutersLogic { + return &ListRoutersLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListRoutersLogic) ListRouters(req *types.ListRoutersReq) (resp *types.ListRoutersResp, err error) { + // todo: add your logic here and delete this line + ListRoutersReq := &openstack.ListRoutersReq{} + err = copier.CopyWithOption(ListRoutersReq, req, copier.Option{Converters: utils.Converters}) + ListRoutersResp, err := l.svcCtx.OpenstackRpc.ListRouters(l.ctx, ListRoutersReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListRoutersResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListRoutersResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listsecuritygroupruleslogic.go b/api/internal/logic/vm/listsecuritygroupruleslogic.go new file mode 100644 index 00000000..aeffcd26 --- /dev/null +++ b/api/internal/logic/vm/listsecuritygroupruleslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListSecurityGroupRulesLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListSecurityGroupRulesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListSecurityGroupRulesLogic { + return &ListSecurityGroupRulesLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListSecurityGroupRulesLogic) ListSecurityGroupRules(req *types.ListSecurityGroupRulesReq) (resp *types.ListSecurityGroupRulesResp, err error) { + // todo: add your logic here and delete this line + ListSecurityGroupRulesReq := &openstack.ListSecurityGroupRulesReq{} + err = copier.CopyWithOption(ListSecurityGroupRulesReq, req, copier.Option{Converters: utils.Converters}) + ListSecurityGroupRulesResp, err := l.svcCtx.OpenstackRpc.ListSecurityGroupRules(l.ctx, ListSecurityGroupRulesReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListSecurityGroupRulesResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListSecurityGroupRulesResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listsecuritygroupslogic.go b/api/internal/logic/vm/listsecuritygroupslogic.go new file mode 100644 index 00000000..f4f713a5 --- /dev/null +++ b/api/internal/logic/vm/listsecuritygroupslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListSecurityGroupsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListSecurityGroupsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListSecurityGroupsLogic { + return &ListSecurityGroupsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListSecurityGroupsLogic) ListSecurityGroups(req *types.ListSecurityGroupsReq) (resp *types.ListSecurityGroupsResp, err error) { + // todo: add your logic here and delete this line + ListSecurityGroupsReq := &openstack.ListSecurityGroupsReq{} + err = copier.CopyWithOption(ListSecurityGroupsReq, req, copier.Option{Converters: utils.Converters}) + ListSecurityGroupsResp, err := l.svcCtx.OpenstackRpc.ListSecurityGroups(l.ctx, ListSecurityGroupsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListSecurityGroupsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListSecurityGroupsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/listsubnetslogic.go b/api/internal/logic/vm/listsubnetslogic.go new file mode 100644 index 00000000..2497089e --- /dev/null +++ b/api/internal/logic/vm/listsubnetslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ListSubnetsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewListSubnetsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListSubnetsLogic { + return &ListSubnetsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ListSubnetsLogic) ListSubnets(req *types.ListSubnetsReq) (resp *types.ListSubnetsResp, err error) { + // todo: add your logic here and delete this line + ListSubnetsReq := &openstack.ListSubnetsReq{} + err = copier.CopyWithOption(ListSubnetsReq, req, copier.Option{Converters: utils.Converters}) + ListSubnetsResp, err := l.svcCtx.OpenstackRpc.ListSubnets(l.ctx, ListSubnetsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ListSubnetsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ListSubnetsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/migrateserverlogic.go b/api/internal/logic/vm/migrateserverlogic.go new file mode 100644 index 00000000..69169bb4 --- /dev/null +++ b/api/internal/logic/vm/migrateserverlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type MigrateServerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewMigrateServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MigrateServerLogic { + return &MigrateServerLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *MigrateServerLogic) MigrateServer(req *types.MigrateServerReq) (resp *types.MigrateServerResp, err error) { + // todo: add your logic here and delete this line + MigrateServerReq := &openstack.MigrateServerReq{} + err = copier.CopyWithOption(MigrateServerReq, req, copier.Option{Converters: utils.Converters}) + MigrateServerResp, err := l.svcCtx.OpenstackRpc.MigrateServer(l.ctx, MigrateServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&MigrateServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &MigrateServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/removesecuritygrouplogic.go b/api/internal/logic/vm/removesecuritygrouplogic.go new file mode 100644 index 00000000..71ea50b2 --- /dev/null +++ b/api/internal/logic/vm/removesecuritygrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type RemoveSecurityGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewRemoveSecurityGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RemoveSecurityGroupLogic { + return &RemoveSecurityGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *RemoveSecurityGroupLogic) RemoveSecurityGroup(req *types.RemoveSecurityGroupReq) (resp *types.RemoveSecurityGroupResp, err error) { + // todo: add your logic here and delete this line + CreateImageReq := &openstack.CreateImageReq{} + err = copier.CopyWithOption(CreateImageReq, req, copier.Option{Converters: utils.Converters}) + CreateImageResp, err := l.svcCtx.OpenstackRpc.CreateImage(l.ctx, CreateImageReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&CreateImageResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &CreateImageResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/rescueserverlogic.go b/api/internal/logic/vm/rescueserverlogic.go new file mode 100644 index 00000000..49931fad --- /dev/null +++ b/api/internal/logic/vm/rescueserverlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type RescueServerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewRescueServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RescueServerLogic { + return &RescueServerLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *RescueServerLogic) RescueServer(req *types.RescueServerReq) (resp *types.RescueServerResp, err error) { + // todo: add your logic here and delete this line + RescueServerReq := &openstack.RescueServerReq{} + err = copier.CopyWithOption(RescueServerReq, req, copier.Option{Converters: utils.Converters}) + RescueServerResp, err := l.svcCtx.OpenstackRpc.RescueServer(l.ctx, RescueServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&RescueServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &RescueServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/resizeserverlogic.go b/api/internal/logic/vm/resizeserverlogic.go new file mode 100644 index 00000000..87c6c430 --- /dev/null +++ b/api/internal/logic/vm/resizeserverlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ResizeServerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewResizeServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ResizeServerLogic { + return &ResizeServerLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ResizeServerLogic) ResizeServer(req *types.ResizeServerReq) (resp *types.ResizeServerResp, err error) { + // todo: add your logic here and delete this line + ResizeServerReq := &openstack.ResizeServerReq{} + err = copier.CopyWithOption(ResizeServerReq, req, copier.Option{Converters: utils.Converters}) + ResizeServerResp, err := l.svcCtx.OpenstackRpc.ResizeServer(l.ctx, ResizeServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ResizeServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ResizeServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/shelveserverlogic.go b/api/internal/logic/vm/shelveserverlogic.go new file mode 100644 index 00000000..0fd6c10f --- /dev/null +++ b/api/internal/logic/vm/shelveserverlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShelveServerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShelveServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShelveServerLogic { + return &ShelveServerLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShelveServerLogic) ShelveServer(req *types.ShelveServerReq) (resp *types.ShelveServerResp, err error) { + // todo: add your logic here and delete this line + ShelveServerReq := &openstack.ShelveServerReq{} + err = copier.CopyWithOption(ShelveServerReq, req, copier.Option{Converters: utils.Converters}) + ShelveServerResp, err := l.svcCtx.OpenstackRpc.ShelveServer(l.ctx, ShelveServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShelveServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShelveServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showfirewallgroupdetailslogic.go b/api/internal/logic/vm/showfirewallgroupdetailslogic.go new file mode 100644 index 00000000..89813126 --- /dev/null +++ b/api/internal/logic/vm/showfirewallgroupdetailslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowFirewallGroupDetailsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowFirewallGroupDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowFirewallGroupDetailsLogic { + return &ShowFirewallGroupDetailsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowFirewallGroupDetailsLogic) ShowFirewallGroupDetails(req *types.ShowFirewallGroupDetailsReq) (resp *types.ShowFirewallGroupDetailsResp, err error) { + // todo: add your logic here and delete this line + ShowFirewallGroupDetailsReq := &openstack.ShowFirewallGroupDetailsReq{} + err = copier.CopyWithOption(ShowFirewallGroupDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowFirewallGroupDetailsResp, err := l.svcCtx.OpenstackRpc.ShowFirewallGroupDetails(l.ctx, ShowFirewallGroupDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowFirewallGroupDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowFirewallGroupDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showfirewallpolicydetailslogic.go b/api/internal/logic/vm/showfirewallpolicydetailslogic.go new file mode 100644 index 00000000..dce3b065 --- /dev/null +++ b/api/internal/logic/vm/showfirewallpolicydetailslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowFirewallPolicyDetailsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowFirewallPolicyDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowFirewallPolicyDetailsLogic { + return &ShowFirewallPolicyDetailsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowFirewallPolicyDetailsLogic) ShowFirewallPolicyDetails(req *types.ShowFirewallPolicyDetailsReq) (resp *types.ShowFirewallPolicyDetailsResp, err error) { + // todo: add your logic here and delete this line + ShowFirewallPolicyDetailsReq := &openstack.ShowFirewallPolicyDetailsReq{} + err = copier.CopyWithOption(ShowFirewallPolicyDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowFirewallPolicyDetailsResp, err := l.svcCtx.OpenstackRpc.ShowFirewallPolicyDetails(l.ctx, ShowFirewallPolicyDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowFirewallPolicyDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowFirewallPolicyDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showfirewallruledetailslogic.go b/api/internal/logic/vm/showfirewallruledetailslogic.go new file mode 100644 index 00000000..1b60c02a --- /dev/null +++ b/api/internal/logic/vm/showfirewallruledetailslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowFirewallRuleDetailsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowFirewallRuleDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowFirewallRuleDetailsLogic { + return &ShowFirewallRuleDetailsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowFirewallRuleDetailsLogic) ShowFirewallRuleDetails(req *types.ShowFirewallRuleDetailsReq) (resp *types.ShowFirewallRuleDetailsResp, err error) { + // todo: add your logic here and delete this line + ShowFirewallRuleDetailsReq := &openstack.ShowFirewallRuleDetailsReq{} + err = copier.CopyWithOption(ShowFirewallRuleDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowFirewallRuleDetailsResp, err := l.svcCtx.OpenstackRpc.ShowFirewallRuleDetails(l.ctx, ShowFirewallRuleDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowFirewallRuleDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowFirewallRuleDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showfloatingipdetailslogic.go b/api/internal/logic/vm/showfloatingipdetailslogic.go new file mode 100644 index 00000000..38ee82c8 --- /dev/null +++ b/api/internal/logic/vm/showfloatingipdetailslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowFloatingIPDetailsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowFloatingIPDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowFloatingIPDetailsLogic { + return &ShowFloatingIPDetailsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowFloatingIPDetailsLogic) ShowFloatingIPDetails(req *types.ShowFloatingIPDetailsReq) (resp *types.ShowFloatingIPDetailsResp, err error) { + // todo: add your logic here and delete this line + ShowFloatingIPDetailsReq := &openstack.ShowFloatingIPDetailsReq{} + err = copier.CopyWithOption(ShowFloatingIPDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowFloatingIPDetailsResp, err := l.svcCtx.OpenstackRpc.ShowFloatingIPDetails(l.ctx, ShowFloatingIPDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowFloatingIPDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowFloatingIPDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/shownetworksegmentrangedetailslogic.go b/api/internal/logic/vm/shownetworksegmentrangedetailslogic.go new file mode 100644 index 00000000..68e69c39 --- /dev/null +++ b/api/internal/logic/vm/shownetworksegmentrangedetailslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowNetworkSegmentRangeDetailsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowNetworkSegmentRangeDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowNetworkSegmentRangeDetailsLogic { + return &ShowNetworkSegmentRangeDetailsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowNetworkSegmentRangeDetailsLogic) ShowNetworkSegmentRangeDetails(req *types.ShowNetworkSegmentRangeDetailsReq) (resp *types.ShowNetworkSegmentRangeDetailsResp, err error) { + // todo: add your logic here and delete this line + ShowNetworkSegmentRangeDetailsReq := &openstack.ShowNetworkSegmentRangeDetailsReq{} + err = copier.CopyWithOption(ShowNetworkSegmentRangeDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowNetworkSegmentRangeDetailsResp, err := l.svcCtx.OpenstackRpc.ShowNetworkSegmentRangeDetails(l.ctx, ShowNetworkSegmentRangeDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowNetworkSegmentRangeDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowNetworkSegmentRangeDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showportdetailslogic.go b/api/internal/logic/vm/showportdetailslogic.go new file mode 100644 index 00000000..6e7ae8c9 --- /dev/null +++ b/api/internal/logic/vm/showportdetailslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowPortDetailsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowPortDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowPortDetailsLogic { + return &ShowPortDetailsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowPortDetailsLogic) ShowPortDetails(req *types.ShowPortDetailsReq) (resp *types.ShowPortDetailsResp, err error) { + // todo: add your logic here and delete this line + ShowPortDetailsReq := &openstack.ShowPortDetailsReq{} + err = copier.CopyWithOption(ShowPortDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowPortDetailsResp, err := l.svcCtx.OpenstackRpc.ShowPortDetails(l.ctx, ShowPortDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowPortDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowPortDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showrouterdetailslogic.go b/api/internal/logic/vm/showrouterdetailslogic.go new file mode 100644 index 00000000..ebc53ad1 --- /dev/null +++ b/api/internal/logic/vm/showrouterdetailslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowRouterDetailsLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowRouterDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowRouterDetailsLogic { + return &ShowRouterDetailsLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowRouterDetailsLogic) ShowRouterDetails(req *types.ShowRouterDetailsReq) (resp *types.ShowRouterDetailsResp, err error) { + // todo: add your logic here and delete this line + ShowRouterDetailsReq := &openstack.ShowRouterDetailsReq{} + err = copier.CopyWithOption(ShowRouterDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowRouterDetailsResp, err := l.svcCtx.OpenstackRpc.ShowRouterDetails(l.ctx, ShowRouterDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowRouterDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowRouterDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showsecuritygrouplogic.go b/api/internal/logic/vm/showsecuritygrouplogic.go new file mode 100644 index 00000000..4eb4aa16 --- /dev/null +++ b/api/internal/logic/vm/showsecuritygrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowSecurityGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowSecurityGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowSecurityGroupLogic { + return &ShowSecurityGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowSecurityGroupLogic) ShowSecurityGroup(req *types.ShowSecurityGroupReq) (resp *types.ShowSecurityGroupResp, err error) { + // todo: add your logic here and delete this line + ShowSecurityGroupReq := &openstack.ShowSecurityGroupReq{} + err = copier.CopyWithOption(ShowSecurityGroupReq, req, copier.Option{Converters: utils.Converters}) + ShowSecurityGroupResp, err := l.svcCtx.OpenstackRpc.ShowSecurityGroup(l.ctx, ShowSecurityGroupReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowSecurityGroupResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowSecurityGroupResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/showsecuritygrouprulelogic.go b/api/internal/logic/vm/showsecuritygrouprulelogic.go new file mode 100644 index 00000000..3edf3a4c --- /dev/null +++ b/api/internal/logic/vm/showsecuritygrouprulelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ShowSecurityGroupRuleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewShowSecurityGroupRuleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShowSecurityGroupRuleLogic { + return &ShowSecurityGroupRuleLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *ShowSecurityGroupRuleLogic) ShowSecurityGroupRule(req *types.ShowSecurityGroupRuleReq) (resp *types.ShowSecurityGroupRuleResp, err error) { + // todo: add your logic here and delete this line + ShowSecurityGroupRuleReq := &openstack.ShowSecurityGroupRuleReq{} + err = copier.CopyWithOption(ShowSecurityGroupRuleReq, req, copier.Option{Converters: utils.Converters}) + ShowSecurityGroupRuleResp, err := l.svcCtx.OpenstackRpc.ShowSecurityGroupRule(l.ctx, ShowSecurityGroupRuleReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowSecurityGroupRuleResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowSecurityGroupRuleResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/suspendserverlogic.go b/api/internal/logic/vm/suspendserverlogic.go new file mode 100644 index 00000000..5e246920 --- /dev/null +++ b/api/internal/logic/vm/suspendserverlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type SuspendServerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewSuspendServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SuspendServerLogic { + return &SuspendServerLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *SuspendServerLogic) SuspendServer(req *types.SuspendServerReq) (resp *types.SuspendServerResp, err error) { + // todo: add your logic here and delete this line + SuspendServerReq := &openstack.SuspendServerReq{} + err = copier.CopyWithOption(SuspendServerReq, req, copier.Option{Converters: utils.Converters}) + SuspendServerResp, err := l.svcCtx.OpenstackRpc.SuspendServer(l.ctx, SuspendServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&SuspendServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &SuspendServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/unpauseserverlogic.go b/api/internal/logic/vm/unpauseserverlogic.go new file mode 100644 index 00000000..f01651ca --- /dev/null +++ b/api/internal/logic/vm/unpauseserverlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UnpauseServerLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUnpauseServerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UnpauseServerLogic { + return &UnpauseServerLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UnpauseServerLogic) UnpauseServer(req *types.UnpauseServerReq) (resp *types.UnpauseServerResp, err error) { + // todo: add your logic here and delete this line + UnpauseServerReq := &openstack.UnpauseServerReq{} + err = copier.CopyWithOption(UnpauseServerReq, req, copier.Option{Converters: utils.Converters}) + UnpauseServerResp, err := l.svcCtx.OpenstackRpc.UnpauseServer(l.ctx, UnpauseServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UnpauseServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UnpauseServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/unrescuelogic.go b/api/internal/logic/vm/unrescuelogic.go new file mode 100644 index 00000000..9cde0bc7 --- /dev/null +++ b/api/internal/logic/vm/unrescuelogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UnRescueLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUnRescueLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UnRescueLogic { + return &UnRescueLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UnRescueLogic) UnRescue(req *types.UnRescueServerReq) (resp *types.UnRescueServerResp, err error) { + // todo: add your logic here and delete this line + UnRescueServerReq := &openstack.UnRescueServerReq{} + err = copier.CopyWithOption(UnRescueServerReq, req, copier.Option{Converters: utils.Converters}) + UnRescueServerResp, err := l.svcCtx.OpenstackRpc.UnRescue(l.ctx, UnRescueServerReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UnRescueServerResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UnRescueServerResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/updatefirewallgrouplogic.go b/api/internal/logic/vm/updatefirewallgrouplogic.go new file mode 100644 index 00000000..c7ea460c --- /dev/null +++ b/api/internal/logic/vm/updatefirewallgrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateFirewallGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateFirewallGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateFirewallGroupLogic { + return &UpdateFirewallGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UpdateFirewallGroupLogic) UpdateFirewallGroup(req *types.UpdateFirewallGroupReq) (resp *types.UpdateFirewallGroupResp, err error) { + // todo: add your logic here and delete this line + UpdateFirewallGroupReq := &openstack.UpdateFirewallGroupReq{} + err = copier.CopyWithOption(UpdateFirewallGroupReq, req, copier.Option{Converters: utils.Converters}) + UpdateFirewallGroupResp, err := l.svcCtx.OpenstackRpc.UpdateFirewallGroup(l.ctx, UpdateFirewallGroupReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UpdateFirewallGroupResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UpdateFirewallGroupResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/updatefloatingiplogic.go b/api/internal/logic/vm/updatefloatingiplogic.go new file mode 100644 index 00000000..7af49686 --- /dev/null +++ b/api/internal/logic/vm/updatefloatingiplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateFloatingIPLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateFloatingIPLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateFloatingIPLogic { + return &UpdateFloatingIPLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UpdateFloatingIPLogic) UpdateFloatingIP(req *types.UpdateFloatingIPReq) (resp *types.UpdateFloatingIPResp, err error) { + // todo: add your logic here and delete this line + UpdateFloatingIPReq := &openstack.UpdateFloatingIPReq{} + err = copier.CopyWithOption(UpdateFloatingIPReq, req, copier.Option{Converters: utils.Converters}) + UpdateFloatingIPResp, err := l.svcCtx.OpenstackRpc.UpdateFloatingIP(l.ctx, UpdateFloatingIPReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UpdateFloatingIPResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UpdateFloatingIPResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/updatenetworksegmentrangeslogic.go b/api/internal/logic/vm/updatenetworksegmentrangeslogic.go new file mode 100644 index 00000000..5d8cfbe8 --- /dev/null +++ b/api/internal/logic/vm/updatenetworksegmentrangeslogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateNetworkSegmentRangesLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateNetworkSegmentRangesLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateNetworkSegmentRangesLogic { + return &UpdateNetworkSegmentRangesLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UpdateNetworkSegmentRangesLogic) UpdateNetworkSegmentRanges(req *types.UpdateNetworkSegmentRangesReq) (resp *types.UpdateNetworkSegmentRangesResp, err error) { + // todo: add your logic here and delete this line + UpdateNetworkSegmentRangesReq := &openstack.UpdateNetworkSegmentRangesReq{} + err = copier.CopyWithOption(UpdateNetworkSegmentRangesReq, req, copier.Option{Converters: utils.Converters}) + UpdateNetworkSegmentRangesResp, err := l.svcCtx.OpenstackRpc.UpdateNetworkSegmentRanges(l.ctx, UpdateNetworkSegmentRangesReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UpdateNetworkSegmentRangesResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UpdateNetworkSegmentRangesResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/updateportlogic.go b/api/internal/logic/vm/updateportlogic.go new file mode 100644 index 00000000..fae09088 --- /dev/null +++ b/api/internal/logic/vm/updateportlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdatePortLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdatePortLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdatePortLogic { + return &UpdatePortLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UpdatePortLogic) UpdatePort(req *types.UpdatePortReq) (resp *types.UpdatePortResp, err error) { + // todo: add your logic here and delete this line + UpdatePortReq := &openstack.UpdatePortReq{} + err = copier.CopyWithOption(UpdatePortReq, req, copier.Option{Converters: utils.Converters}) + UpdatePortResp, err := l.svcCtx.OpenstackRpc.UpdatePort(l.ctx, UpdatePortReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UpdatePortResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UpdatePortResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/updaterouterlogic.go b/api/internal/logic/vm/updaterouterlogic.go new file mode 100644 index 00000000..17b4c03c --- /dev/null +++ b/api/internal/logic/vm/updaterouterlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateRouterLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateRouterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateRouterLogic { + return &UpdateRouterLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UpdateRouterLogic) UpdateRouter(req *types.UpdateRouterReq) (resp *types.UpdateRouterResp, err error) { + // todo: add your logic here and delete this line + UpdateRouterReq := &openstack.UpdateRouterReq{} + err = copier.CopyWithOption(UpdateRouterReq, req, copier.Option{Converters: utils.Converters}) + UpdateRouterResp, err := l.svcCtx.OpenstackRpc.UpdateRouter(l.ctx, UpdateRouterReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UpdateRouterResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UpdateRouterResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/updatesecuritygrouplogic.go b/api/internal/logic/vm/updatesecuritygrouplogic.go new file mode 100644 index 00000000..79713476 --- /dev/null +++ b/api/internal/logic/vm/updatesecuritygrouplogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateSecurityGroupLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateSecurityGroupLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateSecurityGroupLogic { + return &UpdateSecurityGroupLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UpdateSecurityGroupLogic) UpdateSecurityGroup(req *types.UpdateSecurityGroupReq) (resp *types.UpdateSecurityGroupResp, err error) { + // todo: add your logic here and delete this line + UpdateSecurityGroupReq := &openstack.UpdateSecurityGroupReq{} + err = copier.CopyWithOption(UpdateSecurityGroupReq, req, copier.Option{Converters: utils.Converters}) + UpdateSecurityGroupResp, err := l.svcCtx.OpenstackRpc.UpdateSecurityGroup(l.ctx, UpdateSecurityGroupReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UpdateSecurityGroupResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UpdateSecurityGroupResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/logic/vm/updatesubnetlogic.go b/api/internal/logic/vm/updatesubnetlogic.go new file mode 100644 index 00000000..af757571 --- /dev/null +++ b/api/internal/logic/vm/updatesubnetlogic.go @@ -0,0 +1,48 @@ +package vm + +import ( + "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" + + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" + "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateSubnetLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateSubnetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateSubnetLogic { + return &UpdateSubnetLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *UpdateSubnetLogic) UpdateSubnet(req *types.UpdateSubnetReq) (resp *types.UpdateSubnetResp, err error) { + // todo: add your logic here and delete this line + UpdateSubnetReq := &openstack.UpdateSubnetReq{} + err = copier.CopyWithOption(UpdateSubnetReq, req, copier.Option{Converters: utils.Converters}) + UpdateSubnetResp, err := l.svcCtx.OpenstackRpc.UpdateSubnet(l.ctx, UpdateSubnetReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&UpdateSubnetResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &UpdateSubnetResp, copier.Option{Converters: utils.Converters}) + return resp, err +} diff --git a/api/internal/types/types.go b/api/internal/types/types.go index 002edab4..7073c61b 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -2507,8 +2507,9 @@ type Limits struct { } type GetComputeLimitsReq struct { - Limit int32 `json:"limit,optional"` - OffSet int32 `json:"offSet,optional"` + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` } type GetComputeLimitsResp struct { @@ -2540,8 +2541,9 @@ type VolumeLimits struct { } type GetVolumeLimitsReq struct { - Limit int32 `json:"limit,optional"` - OffSet int32 `json:"offSet,optional"` + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` } type GetVolumeLimitsResp struct { @@ -2552,8 +2554,9 @@ type GetVolumeLimitsResp struct { } type ListServersReq struct { - Limit int32 `form:"limit,optional"` - OffSet int32 `form:"offSet,optional"` + Limit int32 `form:"limit,optional"` + OffSet int32 `form:"offSet,optional"` + Platform string `json:"platform,optional"` } type ListServersResp struct { @@ -2582,6 +2585,7 @@ type Servers_links struct { } type ListServersDetailedReq struct { + Platform string `json:"platform,optional"` } type ListServersDetailedResp struct { @@ -2605,6 +2609,7 @@ type ServersDetailed struct { type GetServersDetailedByIdReq struct { ServerId string `form:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` } type GetServersDetailedByIdResp struct { @@ -2692,6 +2697,7 @@ type ExtraSpecs struct { type UpdateServerReq struct { ServerId string `form:"server_id" copier:"ServerId"` ServerUpdate ServerUpdate `json:"server_update" copier:"ServerUpdate"` + Platform string `json:"platform,optional"` } type ServerUpdate struct { @@ -2709,6 +2715,7 @@ type StartServerReq struct { ServerId string `json:"server_id" copier:"ServerId"` Action []map[string]string `json:"action,optional" copier:"Action"` Start_action string `json:"start_action" copier:"start_action"` + Platform string `json:"platform,optional"` } type StartServerResp struct { @@ -2721,6 +2728,7 @@ type StopServerReq struct { ServerId string `json:"server_id" copier:"ServerId"` Action []map[string]string `json:"action,optional" copier:"Action"` Stop_action string `json:"stop_action" copier:"stop_action"` + Platform string `json:"platform,optional"` } type StopServerResp struct { @@ -2732,6 +2740,7 @@ type StopServerResp struct { type RebootServerReq struct { ServerId string `json:"server_id" copier:"ServerId"` Reboot Reboot `json:"reboot" copier:"Reboot"` + Platform string `json:"platform,optional"` } type RebootServerResp struct { @@ -2748,6 +2757,7 @@ type PauseServerReq struct { ServerId string `json:"server_id" copier:"ServerId"` Action []map[string]string `json:"Action,optional" copier:"Action"` Pause_action string `json:"pause_action" copier:"pause_action"` + Platform string `json:"platform,optional"` } type PauseServerResp struct { @@ -2756,8 +2766,22 @@ type PauseServerResp struct { Code int32 `json:"code,omitempty"` } +type UnpauseServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Unpause_action string `json:"unpause_action" copier:"unpause_action"` + Platform string `json:"platform,optional"` +} + +type UnpauseServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + type DeleteServerReq struct { ServerId string `form:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` } type DeleteServerResp struct { @@ -2767,7 +2791,8 @@ type DeleteServerResp struct { } type CreateServerReq struct { - Server Server `json:"server" copier:"Server"` + Server Server `json:"server" copier:"Server"` + Platform string `json:"platform,optional"` } type CreateServerResp struct { @@ -2790,14 +2815,14 @@ type CreNetwork struct { } type ServerResp struct { - Id string `json:"id" copier:"Id"` - Links []Links `json:"links" copier:"Links"` - OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` - SecurityGroups []Security_groups `json:"security_groups" copier:"SecurityGroups"` - AdminPass string `json:"adminPass" copier:"AdminPass"` + Id string `json:"id" copier:"Id"` + Links []Links `json:"links" copier:"Links"` + OSDCFDiskConfig string `json:"OS_DCF_diskConfig" copier:"OSDCFDiskConfig"` + SecurityGroups []Security_groups_server `json:"security_groups" copier:"SecurityGroups"` + AdminPass string `json:"adminPass" copier:"AdminPass"` } -type Security_groups struct { +type Security_groups_server struct { Name string `json:"name" copier:"Name"` } @@ -2809,8 +2834,224 @@ type Block_device_mapping_v2 struct { DeleteOnTermination bool `json:"delete_on_termination" copier:"DeleteOnTermination"` } +type RebuildServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Rebuild Rebuild `json:"rebuild" copier:"Rebuild"` +} + +type RebuildServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type Rebuild struct { + ImageRef string `json:"imageRef" copier:"ImageRef"` + AccessIPv4 string `json:"accessIPv4" copier:"AccessIPv4"` + AccessIPv6 string `json:"accessIPv6" copier:"AccessIPv6"` + AdminPass string `json:"adminPass" copier:"AdminPass"` + Name string `json:"name" copier:"Name"` + PreserveEphemeral bool `json:"preserve_ephemeral" copier:"PreserveEphemeral"` + Description string `json:"description" copier:"Description"` + KeyName string `json:"key_name" copier:"KeyName"` + UserData string `json:"user_data" copier:"UserData"` + Hostname string `json:"hostname" copier:"Hostname"` + Metadata MetadataServer `json:"metadata" copier:"Metadata"` + Personality []Personality `json:"personality" copier:"Personality"` + Trusted_image_certificates []Trusted_image_certificates `json:"trusted_image_certificates" copier:"trusted_image_certificates"` +} + +type MetadataServer struct { +} + +type Personality struct { + Path string `json:"path" copier:"Path"` + Contents string `json:"contents" copier:"Contents"` +} + +type Trusted_image_certificates struct { +} + +type ResizeServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Resize Resize `json:"resize" copier:"Resize"` +} + +type ResizeServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type Resize struct { + FlavorRef string `json:"flavorRef" copier:"flavorRef"` +} + +type MigrateServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + MigrateAction string `json:"migrate_action,optional" copier:"MigrateAction"` + Migrate Migrate `json:"migrate" copier:"Migrate"` +} + +type MigrateServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type Migrate struct { + Host []map[string]string `json:"host,optional" copier:"host"` +} + +type ShelveServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Shelve_action string `json:"shelve_action" copier:"shelve_action"` + Platform string `json:"platform,optional"` +} + +type ShelveServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type RescueServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + Rescue Rescue `json:"rescue" copier:"Rescue"` +} + +type RescueServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type Rescue struct { + AdminPass string `json:"adminPass" copier:"AdminPass"` + RescueImageRef string `json:"rescue_image_ref" copier:"RescueImageRef"` +} + +type UnRescueServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Platform string `json:"platform,optional"` + UnRescue_action string `json:"UnRescue_action" copier:"UnRescue_action"` + Rescue Rescue `json:"rescue" copier:"Rescue"` +} + +type UnRescueServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type ChangeAdministrativePasswordReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Changepassword string `json:"changePassword" copier:"Changepassword"` + Platform string `json:"platform,optional"` + ChangePassword ChangePassword `json:"changepassword" copier:"ChangePassword"` +} + +type ChangeAdministrativePasswordResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type ChangePassword struct { + AdminPass string `json:"adminPass" copier:"AdminPass"` +} + +type SuspendServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Platform string `json:"platform,optional"` + UnRescue_action string `json:"UnRescue_action" copier:"UnRescue_action"` + Rescue Rescue `json:"rescue" copier:"Rescue"` +} + +type SuspendServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type AddSecurityGroupToServerReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Action []map[string]string `json:"Action,optional" copier:"Action"` + Platform string `json:"platform,optional"` + UnRescue_action string `json:"UnRescue_action" copier:"UnRescue_action"` + AddSecurityGroup AddSecurityGroup `json:"addSecurityGroup" copier:"AddSecurityGroup"` +} + +type AddSecurityGroupToServerResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type AddSecurityGroup struct { + Name string `json:"name" copier:"Name"` +} + +type RemoveSecurityGroupReq struct { + ServerId string `json:"server_id" copier:"ServerId"` + Platform string `json:"platform,optional"` + RemoveSecurityGroup RemoveSecurityGroup `json:"removeSecurityGroup" copier:"RemoveSecurityGroup"` +} + +type RemoveSecurityGroupResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type RemoveSecurityGroup struct { + Name string `json:"name" copier:"Name"` +} + +type CreateFlavorReq struct { + Platform string `json:"platform,optional"` + Flavor FlavorServer `json:"flavor" copier:"Flavor"` +} + +type CreateFlavorResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + +type FlavorServer struct { + Name string `json:"name" copier:"Name"` + Ram uint32 `json:"ram" copier:"Ram"` + Disk uint32 `json:"disk" copier:"disk"` + Vcpus uint32 `json:"vcpus" copier:"vcpus"` + Id string `json:"id" copier:"id"` + Rxtx_factor float64 `json:"rxtx_factor" copier:"rxtx_factor"` + Description string `json:"description" copier:"description"` +} + +type DeleteFlavorReq struct { + Platform string `json:"platform,optional"` + ServerId string `json:"server_id" copier:"ServerId"` + FlavorId string `json:"flavor_id" copier:"FlavorId"` +} + +type DeleteFlavorResp struct { + Msg string `json:"msg,omitempty"` + ErrorMsg string `json:"errorMsg,omitempty"` + Code int32 `json:"code,omitempty"` +} + type ListImagesReq struct { - Limit int32 `form:"limit,optional"` + Limit int32 `form:"limit,optional"` + Platform string `json:"platform,optional"` } type ListImagesResp struct { @@ -2858,6 +3099,7 @@ type CreateImageReq struct { Min_ram int32 `json:"min_ram" copier:"Min_ram"` Name string `json:"name" copier:"Name"` Protected bool `json:"protected" copier:"Protected"` + Platform string `json:"platform,optional"` Visibility string `json:"visibility" copier:"Visibility"` } @@ -2878,7 +3120,8 @@ type CreateImageResp struct { } type UploadOsImageReq struct { - ImageId string `form:"image_id" copier:"ImageId"` + ImageId string `form:"image_id" copier:"ImageId"` + Platform string `json:"platform,optional"` } type UploadOsImageResp struct { @@ -2888,7 +3131,8 @@ type UploadOsImageResp struct { } type DeleteImageReq struct { - ImageId string `form:"image_id" copier:"ImageId"` + ImageId string `form:"image_id" copier:"ImageId"` + Platform string `json:"platform,optional"` } type DeleteImageResp struct { @@ -2898,6 +3142,7 @@ type DeleteImageResp struct { } type ListNetworksReq struct { + Platform string `json:"platform,optional"` } type ListNetworksResp struct { @@ -2937,6 +3182,7 @@ type Network struct { type DeleteNetworkReq struct { NetworkId string `form:"network_id" copier:"NetworkId"` + Platform string `json:"platform,optional"` } type DeleteNetworkResp struct { @@ -2946,7 +3192,8 @@ type DeleteNetworkResp struct { } type CreateNetworkReq struct { - Network CreateNetwork `json:"network" copier:"Network"` + Network CreateNetwork `json:"network" copier:"Network"` + Platform string `json:"platform,optional"` } type CreateNetworkResp struct { @@ -2963,7 +3210,8 @@ type CreateNetwork struct { } type CreateSubnetReq struct { - Subnet Subnet `json:"subnet" copier:"Subnet"` + Subnet Subnet `json:"subnet" copier:"Subnet"` + Platform string `json:"platform,optional"` } type CreateSubnetResp struct { @@ -3018,6 +3266,7 @@ type Allocation_pools struct { type ShowNetworkDetailsReq struct { NetworkId string `form:"network_id" copier:"NetworkId"` + Platform string `json:"platform,optional"` } type ShowNetworkDetailsResp struct { @@ -3056,6 +3305,7 @@ type Networkdetail struct { type UpdateNetworkReq struct { NetworkId string `form:"network_id" copier:"NetworkId"` Network Network `json:"network" copier:"Network"` + Platform string `json:"platform,optional"` } type UpdateNetworkResp struct { @@ -3066,7 +3316,8 @@ type UpdateNetworkResp struct { } type BulkCreateNetworksReq struct { - Network []CreateNetwork `json:"network" copier:"Network"` + Network []CreateNetwork `json:"network" copier:"Network"` + Platform string `json:"platform,optional"` } type BulkCreateNetworksResp struct { @@ -3076,7 +3327,988 @@ type BulkCreateNetworksResp struct { ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` } +type ListSubnetsReq struct { + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` +} + +type ListSubnetsResp struct { + Subnets []Subnets `json:"subnets" copier:"Subnets"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Subnets struct { + Name string `json:"name,optional" copier:"Name"` + Enable_dhcp bool `json:"enable_dhcp,optional" copier:"Enable_dhcp"` + NetworkId string `json:"network_id,optional" copier:"NetworkId"` + SegmentId string `json:"segment_id,optional" copier:"SegmentId"` + ProjectId string `json:"project_id,optional" copier:"ProjectId"` + TenantId string `json:"tenant_id,optional" copier:"TenantId"` + DnsNameservers string `json:"dns_nameservers,optional" copier:"DnsNameservers"` + Dns_publish_fixed_ip bool `json:"dns_publish_fixed_ip,optional" copier:"dns_publish_fixed_ip"` + Allocation_pools []Allocation_pool `json:"allocation_pools,optional" copier:"allocation_pools"` + Host_routes []string `json:"host_routes,optional" copier:"host_routes"` + Ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + Gateway_ip string `json:"gateway_ip,optional" copier:"gateway_ip"` + Cidr string `json:"cidr,optional" copier:"cidr"` + Id string `json:"id,optional" copier:"id"` + Description string `json:"description,optional" copier:"description"` + Ipv6_address_mode string `json:"ipv6_address_mode,optional" copier:"ipv6_address_mode"` + Ipv6_ra_mode string `json:"ipv6_ra_mode,optional" copier:"ipv6_ra_mode"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Service_types []string `json:"service_types,optional" copier:"service_types"` + Subnetpool_id string `json:"subnetpool_id,optional" copier:"subnetpool_id"` + Tags []string `json:"tags,optional" copier:"tags"` + Updated_at string `json:"updated_at,optional" copier:"updated_at"` +} + +type Allocation_pool struct { + Start string `json:"start,optional" copier:"start"` + End string `json:"end,optional" copier:"end"` +} + +type DeleteSubnetReq struct { + SubnetId string `json:"subnet_id,optional" copier:"subnetId"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type DeleteSubnetResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type UpdateSubnetReq struct { + SubnetId string `json:"subnet_id,optional" copier:"subnetId"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type UpdateSubnetResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type CreateNetworkSegmentRangeReq struct { + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type CreateNetworkSegmentRangeResp struct { + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Network_segment_range struct { + Id string `json:"id,optional" copier:"id"` + Name string `json:"name,optional" copier:"name"` + Description string `json:"description,optional" copier:"description"` + Shared bool `json:"shared,optional" copier:"shared"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Network_type string `json:"network_type,optional" copier:"network_type"` + Physical_network string `json:"physical_network,optional" copier:"physical_network"` + Minimum uint32 `json:"minimum,optional" copier:"minimum"` + Maximum uint32 `json:"maximum,optional" copier:"maximum"` + Available []uint32 `json:"available,optional" copier:"available"` + Used Used `json:"used,optional" copier:"used"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Tags []string `json:"tags,optional" copier:"tags"` +} + +type Used struct { +} + +type ListNetworkSegmentRangesReq struct { + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` +} + +type ListNetworkSegmentRangesResp struct { + NetworkSegmentRange []Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Network_segment_ranges struct { + Id string `json:"id,optional" copier:"id"` + Name string `json:"name,optional" copier:"name"` + Description string `json:"description,optional" copier:"description"` + Shared bool `json:"shared,optional" copier:"shared"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Network_type string `json:"network_type,optional" copier:"network_type"` + Physical_network string `json:"physical_network,optional" copier:"physical_network"` + Minimum uint32 `json:"minimum,optional" copier:"minimum"` + Maximum uint32 `json:"maximum,optional" copier:"maximum"` + Available []uint32 `json:"available,optional" copier:"available"` + Used Used `json:"used,optional" copier:"used"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Tags []string `json:"tags,optional" copier:"tags"` +} + +type DeleteNetworkSegmentRangesReq struct { + Network_segment_range_id string `json:"network_segment_range_id,optional" copier:"network_segment_range_id"` + Platform string `json:"platform,optional"` +} + +type DeleteNetworkSegmentRangesResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type UpdateNetworkSegmentRangesReq struct { + Network_segment_range_id string `json:"network_segment_range_id,optional" copier:"network_segment_range_id"` + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type UpdateNetworkSegmentRangesResp struct { + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ShowNetworkSegmentRangeDetailsReq struct { + Network_segment_range_id string `json:"network_segment_range_id,optional" copier:"network_segment_range_id"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type ShowNetworkSegmentRangeDetailsResp struct { + NetworkSegmentRange Network_segment_range `json:"network_segment_range,optional" copier:"NetworkSegmentRange"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type CreatePortReq struct { + Port Port `json:"port,optional" copier:"port"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type Port struct { + Admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + Dns_domain string `json:"dns_domain,optional" copier:"dns_domain"` + Dns_name string `json:"dns_name,optional" copier:"dns_name"` + Name string `json:"name,optional" copier:"name"` + Network_id string `json:"network_id,optional" copier:"network_id"` + Qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` + Port_security_enabled bool `json:"port_security_enabled,optional" copier:"port_security_enabled"` + Allowed_address_pairs []Allowed_address_pairs `json:"allowed_address_pairs,optional" copier:"allowed_address_pairs"` + Propagate_uplink_status bool `json:"propagate_uplink_status,optional" copier:"propagate_uplink_status"` + Hardware_offload_type string `json:"hardware_offload_type,optional" copier:"hardware_offload_type"` + Created_at string `json:"created_at,optional" copier:"created_at"` + Data_plane_status string `json:"data_plane_status,optional" copier:"data_plane_status"` + Description string `json:"description,optional" copier:"description"` + Device_id string `json:"device_id,optional" copier:"device_id"` + Device_owner string `json:"device_owner,optional" copier:"device_owner"` + Dns_assignment Dns_assignment `json:"dns_assignment,optional" copier:"dns_assignment"` + Id string `json:"id,optional" copier:"id"` + Ip_allocation string `json:"ip_allocation,optional" copier:"ip_allocation"` + Mac_address string `json:"mac_address,optional" copier:"mac_address"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Security_groups []string `json:"security_groups,optional" copier:"revision_number"` + Status uint32 `json:"status,optional" copier:"revision_number"` + Tags []string `json:"tags,optional" copier:"tags"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Updated_at string `json:"updated_at,optional" copier:"updated_at"` + Qos_network_policy_id string `json:"qos_network_policy_id,optional" copier:"qos_network_policy_id"` +} + +type Allowed_address_pairs struct { + Ip_address string `json:"ip_address,optional" copier:"ip_address"` + Mac_address string `json:"mac_address,optional" copier:"mac_address"` +} + +type CreatePortResp struct { + Port Port `json:"port,optional" copier:"port"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ListPortsReq struct { + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` +} + +type ListPortsResp struct { + Ports []PortLists `json:"ports,optional" copier:"ports"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type PortLists struct { + Admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + Allowed_address_pairs []Allowed_address_pairs `json:"allowed_address_pairs,optional" copier:"allowed_address_pairs"` + Created_at string `json:"created_at,optional" copier:"created_at"` + Data_plane_status string `json:"data_plane_status,optional" copier:"data_plane_status"` + Description string `json:"description,optional" copier:"description"` + Device_id string `json:"device_id,optional" copier:"device_id"` + Device_owner string `json:"device_owner,optional" copier:"device_owner"` + Dns_assignment []Dns_assignment `json:"dns_assignment,optional" copier:"dns_assignment"` + Extra_dhcp_opts []Extra_dhcp_opts `json:"extra_dhcp_opts,optional" copier:"extra_dhcp_opts"` + Fixed_ips []Fixed_ips `json:"fixed_ips,optional" copier:"fixed_ips"` + Id string `json:"id,optional" copier:"id"` + Ip_allocation string `json:"ip_allocation,optional" copier:"ip_allocation"` + Mac_address string `json:"mac_address,optional" copier:"mac_address"` + Name string `json:"name,optional" copier:"name"` + Network_id string `json:"network_id,optional" copier:"network_id"` + Port_security_enabled bool `json:"port_security_enabled,optional" copier:"port_security_enabled"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Revision_number uint32 `json:"project_id,optional" copier:"project_id"` + Security_groups []string `json:"security_groups,optional" copier:"security_groups"` + Status string `json:"status,optional" copier:"status"` + Tags []string `json:"tags,optional" copier:"tags"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Updated_at string `json:"updated_at,optional" copier:"updated_at"` + Qos_network_policy_id string `json:"qos_network_policy_id,optional" copier:"qos_network_policy_id"` + Qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` + Propagate_uplink_status bool `json:"propagate_uplink_status,optional" copier:"propagate_uplink_status"` + Hardware_offload_type string `json:"hardware_offload_type,optional" copier:"hardware_offload_type"` +} + +type Dns_assignment struct { + Hostname string `json:"hostname,optional" copier:"hostname"` + Ip_address string `json:"ip_address,optional" copier:"ip_address"` + Opt_name string `json:"opt_name,optional" copier:"opt_name"` +} + +type Extra_dhcp_opts struct { + Opt_value string `json:"opt_value,optional" copier:"opt_value"` + Ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + Fqdn string `json:"fqdn,optional" copier:"fqdn"` +} + +type Fixed_ips struct { + Ip_address string `json:"ip_address,optional" copier:"ip_address"` + Subnet_id string `json:"subnet_id,optional" copier:"subnet_id"` +} + +type DeletePortReq struct { + Port_id string `json:"port_id,optional" copier:"port_id"` + Platform string `json:"platform,optional" copier:"platform"` +} + +type DeletePortResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type UpdatePortReq struct { + Port_id string `json:"port_id,optional" copier:"port_id"` + Port Port `json:"port,optional" copier:"port"` + Platform string `json:"platform,optional" copier:"platform"` +} + +type UpdatePortResp struct { + Port Port `json:"port,optional" copier:"port"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ShowPortDetailsReq struct { + Port_id string `json:"port_id,optional" copier:"port_id"` + Fields string `json:"fields,optional" copier:"fields"` + Platform string `json:"platform,optional" copier:"platform"` +} + +type ShowPortDetailsResp struct { + Port Port `json:"port,optional" copier:"port"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ListRoutersReq struct { + Limit int32 `json:"limit,optional"` + OffSet int32 `json:"offSet,optional"` + Platform string `json:"platform,optional"` +} + +type ListRoutersResp struct { + Routers []Routers `json:"routers,optional" copier:"routers"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Routers struct { + Admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + Availability_zone_hints []Availability_zone_hints `json:"availability_zone_hints,optional" copier:"availability_zone_hints"` + Availability_zones []string `json:"availability_zones,optional" copier:"availability_zones"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Description string `json:"description,optional" copier:"description"` + Distributed string `json:"distributed,optional" copier:"distributed"` + External_gateway_info External_gateway_info `json:"external_gateway_info,optional" copier:"external_gateway_info"` + Flavor_id string `json:"flavor_id,optional" copier:"flavor_id"` + Ha bool `json:"ha,optional" copier:"ha"` + Id bool `json:"id,optional" copier:"id"` + Name string `json:"name,optional" copier:"name"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Routes []Routes `json:"routes,optional" copier:"routes"` + Status string `json:"status,optional" copier:"status"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Service_type_id string `json:"service_type_id,optional" copier:"service_type_id"` + Tags []string `json:"tags,optional" copier:"tags"` + Conntrack_helpers Conntrack_helpers `json:"conntrack_helpers,optional" copier:"conntrack_helpers"` +} + +type Availability_zone_hints struct { +} + +type External_gateway_info struct { + Enable_snat string `json:"enable_snat,optional" copier:"enable_snat"` + External_fixed_ips []External_fixed_ips `json:"external_fixed_ips,optional" copier:"external_fixed_ips"` + Platform string `json:"platform,optional" copier:"platform"` +} + +type External_fixed_ips struct { + Destination string `json:"destination,optional" copier:"destination"` + Subnet_id string `json:"subnet_id,optional" copier:"subnet_id"` +} + +type Routes struct { + Ip_address string `json:"ip_address,optional" copier:"ip_address"` + Nexthop string `json:"nexthop,optional" copier:"nexthop"` +} + +type Conntrack_helpers struct { + Protocol string `json:"protocol,optional" copier:"protocol"` + Helper string `json:"helper,optional" copier:"helper"` + Port uint32 `json:"port,optional" copier:"port"` +} + +type CreateRouterReq struct { + Router Router `json:"router,optional" copier:"router"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type CreateRouterResp struct { + Router Router `json:"router,optional" copier:"router"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Router struct { + Name string `json:"name,optional" copier:"name"` + External_gateway_info External_gateway_info `json:"external_gateway_info,optional" copier:"external_gateway_info"` + Admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + Availability_zone_hints []Availability_zone_hints `json:"availability_zone_hints,optional" copier:"availability_zone_hints"` + Availability_zones []string `json:"availability_zones,optional" copier:"availability_zones"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Description string `json:"description,optional" copier:"description"` + Distributed bool `json:"distributed,optional" copier:"distributed"` + Flavor_id string `json:"flavor_id,optional" copier:"flavor_id"` + Ha bool `json:"ha,optional" copier:"ha"` + Id string `json:"id,optional" copier:"id"` + Routers []Routers `json:"routers,optional" copier:"routers"` + Status string `json:"status,optional" copier:"status"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Service_type_id string `json:"service_type_id,optional" copier:"service_type_id"` + Tags []string `json:"tags,optional" copier:"tags"` + Conntrack_helpers Conntrack_helpers `json:"conntrack_helpers,optional" copier:"conntrack_helpers"` +} + +type UpdateRouterReq struct { + Router Router `json:"router,optional" copier:"router"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type UpdateRouterResp struct { + Router Router `json:"router,optional" copier:"router"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ShowRouterDetailsReq struct { + Router Router `json:"router,optional" copier:"router"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type ShowRouterDetailsResp struct { + Router Router `json:"router,optional" copier:"router"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type DeleteRouterReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Router_id string `json:"router_id,optional" copier:"router_id"` +} + +type DeleteRouterResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ListFloatingIPsReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Limit int32 `json:"limit,optional" copier:"Limit"` + OffSet int32 `json:"offSet,optional" copier:"OffSet"` +} + +type ListFloatingIPsResp struct { + Floatingips []Floatingips `json:"floatingips,omitempty" copier:"floatingips"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Floatingips struct { + Router_id string `json:"router_id,optional" copier:"router_id"` + Description string `json:"description,optional" copier:"description"` + Dns_domain string `json:"dns_domain,optional" copier:"dns_domain"` + Dns_name string `json:"dns_name,optional" copier:"dns_name"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Floating_network_id string `json:"floating_network_id,optional" copier:"floating_network_id"` + Fixed_ip_address string `json:"fixed_ip_address,optional" copier:"fixed_ip_address"` + Floating_ip_address string `json:"floating_ip_address,optional" copier:"floating_ip_address"` + Port_id string `json:"port_id,optional" copier:"port_id"` + Id string `json:"id,optional" copier:"id"` + Status string `json:"status,optional" copier:"status"` + Port_details Port_details `json:"port_details,optional" copier:"port_details"` + Tags []string `json:"tags,optional" copier:"tags"` + Port_forwardings []Port_forwardings `json:"port_forwardings,optional" copier:"port_forwardings"` + Qos_network_policy_id string `json:"qos_network_policy_id,optional" copier:"qos_network_policy_id"` + Qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` +} + +type Port_details struct { + Status string `json:"status,optional" copier:"status"` + Name string `json:"name,optional" copier:"name"` + Admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + Network_id string `json:"network_id,optional" copier:"network_id"` + Device_owner string `json:"device_owner,optional" copier:"device_owner"` + Mac_address string `json:"mac_address,optional" copier:"mac_address"` + Device_id string `json:"device_id,optional" copier:"device_id"` +} + +type Port_forwardings struct { + Protocol string `json:"protocol,optional" copier:"protocol"` + Internal_ip_address string `json:"internal_ip_address,optional" copier:"internal_ip_address"` + Internal_port string `json:"internal_port,optional" copier:"internal_port"` + Internal_port_id string `json:"internal_port_id,optional" copier:"internal_port_id"` + Id string `json:"id,optional" copier:"id"` +} + +type CreateFloatingIPReq struct { + Floatingip Floatingip `json:"floatingip,optional" copier:"floatingip"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type CreateFloatingIPResp struct { + Floatingip Floatingip `json:"floatingip,omitempty" copier:"floatingip"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Floatingip struct { + Fixed_ip_address string `json:"fixed_ip_address,optional" copier:"fixed_ip_address"` + Floating_ip_address string `json:"floating_ip_address,optional" copier:"floating_ip_address"` + Floating_network_id string `json:"floating_network_id,optional" copier:"floating_network_id"` + Id string `json:"id,optional" copier:"id"` + Port_id string `json:"port_id,optional" copier:"port_id"` + Router_id string `json:"router_id,optional" copier:"router_id"` + Status string `json:"status,optional" copier:"status"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Description string `json:"description,optional" copier:"description"` + Dns_domain string `json:"dns_domain,optional" copier:"dns_domain"` + Dns_name string `json:"dns_name,optional" copier:"dns_name"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Tags []string `json:"tags,optional" copier:"tags"` + Port_details Port_details `json:"port_details,optional" copier:"port_details"` + Port_forwardings []Port_forwardings `json:"port_forwardings,optional" copier:"port_forwardings"` + Qos_policy_id string `json:"qos_policy_id,optional" copier:"qos_policy_id"` +} + +type UpdateFloatingIPReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Floatingip_id string `json:"floatingip_id,optional" copier:"floatingip_id"` + Floatingip Floatingip `json:"floatingip,optional" copier:"floatingip"` +} + +type UpdateFloatingIPResp struct { + Floatingip Floatingip `json:"floatingip,omitempty" copier:"floatingip"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type DeleteFloatingIPReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Floatingip_id string `json:"floatingip_id,optional" copier:"floatingip_id"` +} + +type DeleteFloatingIPResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ShowFloatingIPDetailsReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Floatingip_id string `json:"floatingip_id,optional" copier:"floatingip_id"` +} + +type ShowFloatingIPDetailsResp struct { + Floatingip Floatingip `json:"floatingip,omitempty" copier:"floatingip"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ListFirewallGroupsReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Fields string `json:"fields,optional" copier:"fields"` +} + +type ListFirewallGroupsResp struct { + Firewall_groups Firewall_groups `json:"firewall_groups,omitempty" copier:"firewall_groups"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Firewall_groups struct { + AdminStateUp bool `json:"admin_state_up,optional" copier:"AdminStateUp"` + Description string `json:"description,optional" copier:"description"` + Egress_firewall_policy_id string `json:"egress_firewall_policy_id,optional" copier:"egress_firewall_policy_id"` + Id string `json:"id,optional" copier:"id"` + Ingress_firewall_policy_id string `json:"ingress_firewall_policy_id,optional" copier:"ingress_firewall_policy_id"` + Name string `json:"name,optional" copier:"name"` + Ports []string `json:"ports,optional" copier:"ports"` + Shared bool `json:"shared,optional" copier:"shared"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Status string `json:"status,optional" copier:"status"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` +} + +type DeleteFirewallGroupReq struct { + Firewall_group_id string `json:"firewall_group_id,optional" copier:"firewall_group_id"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type DeleteFirewallGroupResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type CreateFirewallGroupReq struct { + Firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Platform string `json:"platform,optional" copier:"Platform"` +} + +type CreateFirewallGroupResp struct { + Firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Firewall_group struct { + Admin_state_up bool `json:"admin_state_up,optional" copier:"admin_state_up"` + Egress_firewall_policy_id string `json:"egress_firewall_policy_id,optional" copier:"egress_firewall_policy_id"` + Ingress_firewall_policy_id string `json:"ingress_firewall_policy_id,optional" copier:"ingress_firewall_policy_id"` + Description string `json:"description,optional" copier:"description"` + Id string `json:"id,optional" copier:"id"` + Name string `json:"name,optional" copier:"name"` + Ports []string `json:"ports,optional" copier:"ports"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Shared bool `json:"shared,optional" copier:"shared"` + Status string `json:"status,optional" copier:"status"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` +} + +type UpdateFirewallGroupReq struct { + Firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_group_id string `json:"firewall_group_id,optional" copier:"firewall_group_id"` +} + +type UpdateFirewallGroupResp struct { + Firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ShowFirewallGroupDetailsReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_group_id string `json:"firewall_group_id,optional" copier:"firewall_group_id"` +} + +type ShowFirewallGroupDetailsResp struct { + Firewall_group Firewall_group `json:"firewall_group,optional" copier:"firewall_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type CreateFirewallPolicyReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_policy Firewall_policy `json:"firewall_policy,optional" copier:"firewall_policy"` +} + +type CreateFirewallPolicyResp struct { + Firewall_policy Firewall_policy `json:"firewall_policy,optional" copier:"firewall_policy"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Firewall_policy struct { + Name string `json:"name,optional" copier:"name"` + Firewall_rules []string `json:"firewall_rules,optional" copier:"firewall_rules"` + Audited bool `json:"audited,optional" copier:"audited"` + Description string `json:"description,optional" copier:"description"` + Id string `json:"id,optional" copier:"id"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Shared bool `json:"shared,optional" copier:"shared"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` +} + +type DeleteFirewallPolicyReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_policy_id string `json:"firewall_policy_id,optional" copier:"firewall_policy_id"` +} + +type DeleteFirewallPolicyResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ListFirewallPoliciesReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Fields string `json:"fields,optional" copier:"fields"` +} + +type ListFirewallPoliciesResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Firewall_policies []Firewall_policies `json:"firewall_policies,optional" copier:"firewall_policies"` +} + +type Firewall_policies struct { + Audited bool `json:"audited,optional" copier:"audited"` + Description string `json:"description,optional" copier:"description"` + Firewall_rules []string `json:"firewall_rules,optional" copier:"firewall_rules"` + Id string `json:"id,optional" copier:"id"` + Name string `json:"name,optional" copier:"name"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Shared bool `json:"shared,optional" copier:"shared"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` +} + +type ShowFirewallPolicyDetailsReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_policy_id string `json:"firewall_policy_id,optional" copier:"firewall_policy_id"` +} + +type ShowFirewallPolicyDetailsResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Firewall_policy Firewall_policy `json:"firewall_policy,optional" copier:"firewall_policy"` +} + +type CreateFirewallRuleReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_rule Firewall_rule `json:"firewall_rule,optional" copier:"firewall_rule"` +} + +type CreateFirewallRuleResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Firewall_rule Firewall_rule `json:"firewall_rule,optional" copier:"firewall_rule"` +} + +type Firewall_rule struct { + Action string `json:"action,optional" copier:"action"` + Description string `json:"description,optional" copier:"description"` + Destination_ip_address string `json:"destination_ip_address,optional" copier:"destination_ip_address"` + Destination_firewall_group_id string `json:"destination_firewall_group_id,optional" copier:"destination_firewall_group_id"` + Destination_port string `json:"destination_port,optional" copier:"destination_port"` + Enabled bool `json:"enabled,optional" copier:"enabled"` + Id string `json:"id,optional" copier:"id"` + Ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + Name string `json:"name,optional" copier:"name"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Protocol string `json:"protocol,optional" copier:"protocol"` + Shared bool `json:"shared,optional" copier:"shared"` + Source_firewall_group_id string `json:"source_firewall_group_id,optional" copier:"source_firewall_group_id"` + Source_ip_address string `json:"source_ip_address,optional" copier:"source_ip_address"` + Source_port string `json:"source_port,optional" copier:"source_port"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` +} + +type DeleteFirewallRuleReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_rule_id string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` +} + +type DeleteFirewallRuleResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ListFirewallRulesReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Fields string `json:"fields,optional" copier:"fields"` +} + +type ListFirewallRulesResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Firewall_rules []Firewall_rules `json:"firewall_rules,optional" copier:"firewall_rules"` +} + +type Firewall_rules struct { + Action string `json:"action,optional" copier:"action"` + Description string `json:"description,optional" copier:"description"` + Destination_ip_address string `json:"destination_ip_address,optional" copier:"destination_ip_address"` + Destination_firewall_group_id string `json:"destination_firewall_group_id,optional" copier:"destination_firewall_group_id"` + Destination_port string `json:"destination_port,optional" copier:"destination_port"` + Enabled bool `json:"enabled,optional" copier:"enabled"` + Id string `json:"id,optional" copier:"id"` + Ip_version uint32 `json:"ip_version,optional" copier:"ip_version"` + Name string `json:"name,optional" copier:"name"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Protocol string `json:"protocol,optional" copier:"protocol"` + Shared bool `json:"shared,optional" copier:"shared"` + Source_firewall_group_id string `json:"source_firewall_group_id,optional" copier:"source_firewall_group_id"` + Source_ip_address string `json:"source_ip_address,optional" copier:"source_ip_address"` + Source_port string `json:"source_port,optional" copier:"source_port"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` +} + +type ShowFirewallRuleDetailsReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_rule_id string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` +} + +type ShowFirewallRuleDetailsResp struct { + Firewall_rule Firewall_rule `json:"firewall_rule,optional" copier:"firewall_rule"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type ListSecurityGroupsReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Fields string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` +} + +type ListSecurityGroupsResp struct { + Security_groups Security_groups `json:"security_groups,optional" copier:"security_groups"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Security_groups struct { + Id string `json:"id,optional" copier:"id"` + Description string `json:"description,optional" copier:"description"` + Name string `json:"name,optional" copier:"name"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Tags []string `json:"tags,optional" copier:"tags"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Stateful bool `json:"stateful,optional" copier:"stateful"` + Shared bool `json:"shared,optional" copier:"shared"` +} + +type CreateSecurityGroupReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Firewall_rule_id string `json:"firewall_rule_id,optional" copier:"firewall_rule_id"` +} + +type CreateSecurityGroupResp struct { + Security_group Security_group `json:"security_group,optional" copier:"security_group"` + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type Security_group struct { + Id string `json:"id,optional" copier:"id"` + Description string `json:"description,optional" copier:"description"` + Name string `json:"name,optional" copier:"name"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Tags []string `json:"tags,optional" copier:"tags"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Stateful bool `json:"stateful,optional" copier:"stateful"` + Shared bool `json:"shared,optional" copier:"shared"` + Security_group_rules []Security_group_rules `json:"security_group_rules,optional" copier:"security_group_rules"` +} + +type Security_group_rules struct { + Direction string `json:"direction,optional" copier:"direction"` + Ethertype string `json:"ethertype,optional" copier:"ethertype"` + Id string `json:"id,optional" copier:"id"` + Port_range_max int64 `json:"port_range_max,optional" copier:"port_range_max"` + Port_range_min int64 `json:"port_range_min,optional" copier:"port_range_min"` + Protocol string `json:"protocol,optional" copier:"protocol"` + Remote_group_id string `json:"remote_group_id,optional" copier:"remote_group_id"` + Remote_ip_prefix string `json:"remote_ip_prefix,optional" copier:"remote_ip_prefix"` + Security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Tags []string `json:"tags,optional" copier:"tags"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Stateful bool `json:"stateful,optional" copier:"stateful"` + Belongs_to_default_sg bool `json:"belongs_to_default_sg,optional" copier:"belongs_to_default_sg"` +} + +type DeleteSecurityGroupReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` +} + +type DeleteSecurityGroupResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` +} + +type UpdateSecurityGroupReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` +} + +type UpdateSecurityGroupResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Security_group Security_group `json:"security_group,optional" copier:"security_group"` +} + +type ShowSecurityGroupReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + Fields string `json:"fields,optional" copier:"fields"` + Verbose string `json:"verbose,optional" copier:"verbose"` +} + +type ShowSecurityGroupResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Security_group Security_group `json:"security_group,optional" copier:"security_group"` +} + +type ListSecurityGroupRulesReq struct { + Platform string `json:"platform,optional" copier:"Platform"` +} + +type ListSecurityGroupRulesResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Security_group_rules Security_group_rules `json:"security_group_rules,optional" copier:"security_group_rules"` +} + +type CreateSecurityGroupRuleReq struct { + Platform string `json:"platform,optional" copier:"Platform"` +} + +type CreateSecurityGroupRuleResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Security_group_rule Security_group_rule `json:"security_group_rule,optional" copier:"security_group_rule"` +} + +type Security_group_rule struct { + Direction string `json:"direction,optional" copier:"direction"` + Ethertype string `json:"ethertype,optional" copier:"ethertype"` + Id string `json:"id,optional" copier:"id"` + Port_range_max int64 `json:"port_range_max,optional" copier:"port_range_max"` + Port_range_min int64 `json:"port_range_min,optional" copier:"port_range_min"` + Protocol string `json:"protocol,optional" copier:"protocol"` + Remote_group_id string `json:"remote_group_id,optional" copier:"remote_group_id"` + Remote_ip_prefix string `json:"remote_ip_prefix,optional" copier:"remote_ip_prefix"` + Security_group_id string `json:"security_group_id,optional" copier:"security_group_id"` + Project_id string `json:"project_id,optional" copier:"project_id"` + Created_at int64 `json:"created_at,optional" copier:"created_at"` + Updated_at int64 `json:"updated_at,optional" copier:"updated_at"` + Revision_number uint32 `json:"revision_number,optional" copier:"revision_number"` + Tags []string `json:"tags,optional" copier:"tags"` + Tenant_id string `json:"tenant_id,optional" copier:"tenant_id"` + Stateful bool `json:"stateful,optional" copier:"stateful"` + Belongs_to_default_sg bool `json:"belongs_to_default_sg,optional" copier:"belongs_to_default_sg"` +} + +type ShowSecurityGroupRuleReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Security_group_rule_id string `json:"security_group_rule_id,optional" copier:"security_group_rule_id"` +} + +type ShowSecurityGroupRuleResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Security_group_rule Security_group_rule `json:"security_group_rule,optional" copier:"security_group_rule"` +} + +type DeleteSecurityGroupRuleReq struct { + Platform string `json:"platform,optional" copier:"Platform"` + Security_group_rule_id string `json:"security_group_rule_id,optional" copier:"security_group_rule_id"` +} + +type DeleteSecurityGroupRuleResp struct { + Code int32 `json:"code,omitempty" copier:"Code"` + Msg string `json:"msg,omitempty" copier:"Msg"` + ErrorMsg string `json:"errorMsg,omitempty" copier:"ErrorMsg"` + Security_group_rule Security_group_rule `json:"security_group_rule,optional" copier:"security_group_rule"` +} + type ListVolumesDetailReq struct { + Platform string `json:"platform,optional"` } type ListVolumesDetailResp struct { @@ -3110,6 +4342,7 @@ type DeleteVolumeReq struct { VolumeId string `form:"volume_id" copier:"VolumeId"` Cascade bool `json:"cascade" copier:"Cascade"` Force bool `json:"force" copier:"force"` + Platform string `json:"platform,optional"` } type DeleteVolumeResp struct { @@ -3119,7 +4352,8 @@ type DeleteVolumeResp struct { } type CreateVolumeReq struct { - Volume Volume `json:"volume" copier:"Volume"` + Volume Volume `json:"volume" copier:"Volume"` + Platform string `json:"platform,optional"` } type CreateVolumeResp struct { @@ -3158,6 +4392,7 @@ type VolumeResp struct { } type ListVolumeTypesReq struct { + Platform string `json:"platform,optional"` } type ListVolumeTypesResp struct { @@ -3184,6 +4419,7 @@ type Extra_specs struct { type UpdateVolumeReq struct { Volume Volume `json:"volume" copier:"Volume"` VolumeId string `json:"volume_id" copier:"VolumeId"` + Platform string `json:"platform,optional"` } type UpdateVolumeResp struct { @@ -3195,6 +4431,7 @@ type UpdateVolumeResp struct { type GetVolumeDetailedByIdReq struct { VolumeId string `form:"volume_id" copier:"VolumeId"` + Platform string `json:"platform,optional"` } type GetVolumeDetailedByIdResp struct { @@ -3226,6 +4463,7 @@ type VolumeDetailed struct { type CreateVolumeTypeReq struct { VolumeType VolumeType `json:"volume_type" copier:"VolumeType"` + Platform string `json:"platform,optional"` } type CreateVolumeTypeResp struct { @@ -3245,6 +4483,7 @@ type VolumeType struct { type DeleteVolumeTypeReq struct { VolumeTypeId string `json:"volume_type_id" copier:"VolumeTypeId"` + Platform string `json:"platform,optional"` } type DeleteVolumeTypeResp struct { @@ -3264,6 +4503,7 @@ type ListVolumesReq struct { CreatedAt string `json:"created_at" copier:"CreatedAt"` ConsumesQuota bool `json:"consumes_quota" copier:"ConsumesQuota"` UpdatedAt string `json:"updated_at" copier:"UpdatedAt"` + Platform string `json:"platform,optional"` } type ListVolumesResp struct { @@ -3280,6 +4520,7 @@ type VolumesList struct { } type ListFlavorsDetailReq struct { + Platform string `json:"platform,optional"` } type ListFlavorsDetailResp struct { @@ -3304,6 +4545,7 @@ type Flavors struct { } type ListNodesReq struct { + Platform string `json:"platform,optional"` Limit int64 `json:"limit" copier:"Limit"` Marker string `json:"marker" copier:"Marker"` SortDir string `json:"sort_dir" copier:"SortDir"` @@ -3344,6 +4586,7 @@ type Nodes struct { } type CreateNodeReq struct { + Platform string `json:"platform,optional"` Name string `json:"name" copier:"Name"` Driver string `json:"driver" copier:"Driver"` DriverInfo DriverInfo `json:"driver_info" copier:"DriverInfo"` @@ -3499,6 +4742,7 @@ type VolumeNode struct { } type DeleteNodeReq struct { + Platform string `json:"platform,optional"` NodeIdent string `json:"node_ident" copier:"NodeIdent"` } @@ -3511,6 +4755,7 @@ type DeleteNodeResp struct { type ShowNodeDetailsReq struct { NodeIdent string `json:"node_ident" copier:"NodeIdent"` Fields []Fields `json:"fields" copier:"Fields"` + Platform string `json:"platform,optional"` } type Fields struct { diff --git a/go.mod b/go.mod index f7e9692e..cae9b25c 100644 --- a/go.mod +++ b/go.mod @@ -11,39 +11,39 @@ require ( github.com/docker/docker v24.0.7+incompatible github.com/ghodss/yaml v1.0.0 github.com/go-redis/redis/v8 v8.11.5 - github.com/go-resty/resty/v2 v2.10.0 + github.com/go-resty/resty/v2 v2.11.0 github.com/go-sql-driver/mysql v1.7.1 github.com/jinzhu/copier v0.4.0 github.com/json-iterator/go v1.1.12 github.com/nacos-group/nacos-sdk-go/v2 v2.2.4 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.18.0 - github.com/prometheus/common v0.45.0 + github.com/prometheus/client_golang v1.19.0 + github.com/prometheus/common v0.50.0 github.com/robfig/cron/v3 v3.0.1 github.com/rs/zerolog v1.28.0 github.com/shopspring/decimal v1.3.1 - github.com/zeromicro/go-zero v1.6.2 + github.com/zeromicro/go-zero v1.6.3 gitlink.org.cn/JointCloud/pcm-kubernetes v0.0.0-20240301071143-347480abff2c - gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240302011808-94128b6ca01d + gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240307072630-6ff50727536a gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5 gitlink.org.cn/jcce-pcm/pcm-ac v0.0.0-20240301085553-f6ad88fa357a + gitlink.org.cn/jcce-pcm/pcm-coordinator v0.1.19 gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20231101085149-724c7c4cc090 gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20240222124813-e275cfa342f4 - go.opentelemetry.io/otel/trace v1.21.0 + go.opentelemetry.io/otel/trace v1.24.0 gonum.org/v1/gonum v0.11.0 - google.golang.org/grpc v1.61.0 - google.golang.org/protobuf v1.32.0 + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.0 gorm.io/datatypes v1.2.0 gorm.io/driver/mysql v1.5.2 gorm.io/gorm v1.25.5 - k8s.io/apimachinery v0.29.1 - k8s.io/client-go v0.29.1 + k8s.io/apimachinery v0.29.2 + k8s.io/client-go v0.29.2 sigs.k8s.io/yaml v1.4.0 ) require ( - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/alibabacloud-go/debug v0.0.0-20190504072949-9472017b5c68 // indirect github.com/alibabacloud-go/tea v1.1.17 // indirect @@ -61,22 +61,22 @@ require ( github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect github.com/docker/go-units v0.5.0 // indirect - github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.3 // indirect github.com/fatih/color v1.16.0 // indirect - github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/jsonpointer v0.20.3 // indirect + github.com/go-openapi/jsonreference v0.20.5 // indirect + github.com/go-openapi/swag v0.22.10 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/mock v1.6.0 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect @@ -86,7 +86,6 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -94,50 +93,51 @@ require ( github.com/opencontainers/image-spec v1.0.2 // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect - github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/client_model v0.6.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/redis/go-redis/v9 v9.4.0 // indirect + github.com/redis/go-redis/v9 v9.5.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231214084401-de9ac5db7246 // indirect + gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231102023739-81a3d353c10d // indirect + gitlink.org.cn/jcce-pcm/pcm-slurm v0.0.0-20231107115628-f74106c47dfa // indirect go.etcd.io/etcd/api/v3 v3.5.12 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect go.etcd.io/etcd/client/v3 v3.5.12 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/exporters/zipkin v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/sdk v1.21.0 // indirect - go.opentelemetry.io/proto/otlp v1.0.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/sdk v1.24.0 // indirect + go.opentelemetry.io/proto/otlp v1.1.0 // indirect go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.18.0 // indirect - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/term v0.16.0 // indirect + go.uber.org/zap v1.27.0 // indirect + golang.org/x/crypto v0.21.0 // indirect + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sync v0.6.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.16.1 // indirect + golang.org/x/tools v0.18.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.29.1 // indirect - k8s.io/klog/v2 v2.110.1 // indirect - k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8 // indirect - k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect + k8s.io/api v0.29.2 // indirect + k8s.io/klog/v2 v2.120.1 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect + k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect ) diff --git a/go.sum b/go.sum index 87c4020e..6905bf91 100644 --- a/go.sum +++ b/go.sum @@ -507,8 +507,8 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= -github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.3 h1:yagOQz/38xJmcNeZJtrUcKjkHRltIaIFXKWeG1SkWGE= +github.com/emicklei/go-restful/v3 v3.11.3/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -551,28 +551,26 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= +github.com/go-openapi/jsonpointer v0.20.3 h1:jykzYWS/kyGtsHfRt6aV8JTB9pcQAXPIA7qlZ5aRlyk= +github.com/go-openapi/jsonpointer v0.20.3/go.mod h1:c7l0rjoouAuIxCm8v/JWKRgMjDG/+/7UBWsXMrv6PsM= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/jsonreference v0.20.5 h1:hutI+cQI+HbSQaIGSfsBsYI0pHk+CATf8Fk5gCSj0yI= +github.com/go-openapi/jsonreference v0.20.5/go.mod h1:thAqAp31UABtI+FQGKAQfmv7DbFpKNUlva2UPCxKu2Y= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.10 h1:4y86NVn7Z2yYd6pfS4Z+Nyh3aAUL3Nul+LMbhFKy0gA= +github.com/go-openapi/swag v0.22.10/go.mod h1:Cnn8BYtRlx6BNE3DPN86f/xkapGIcLWzh3CLEb4C1jI= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-resty/resty/v2 v2.10.0 h1:Qla4W/+TMmv0fOeeRqzEpXPLfTUnR5HZ1+lGs+CkiCo= -github.com/go-resty/resty/v2 v2.10.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= +github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= +github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= @@ -624,8 +622,9 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -708,8 +707,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 h1:/c3QmbOGMGTOumP2iT/rCwB7b0QDGLKzqOmktBjT+Is= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1/go.mod h1:5SN9VR2LTsRFsrEC6FHgRbTWrTHu6tqPeKxEQv15giM= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -730,8 +729,8 @@ github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5ey github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8= -github.com/jackc/pgx/v5 v5.5.2 h1:iLlpgp4Cp/gC9Xuscl7lFL1PhhW+ZLtXZcrfCt4C3tA= -github.com/jackc/pgx/v5 v5.5.2/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= +github.com/jackc/pgx/v5 v5.5.3 h1:Ces6/M3wbDXYpM8JyyPD57ivTtJACFZJd885pdIaV2s= +github.com/jackc/pgx/v5 v5.5.3/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= @@ -816,8 +815,6 @@ github.com/mattn/go-sqlite3 v1.14.15 h1:vfoHhTN1af61xCRSWzFIWzx2YskyMTwHLrExkBOj github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= -github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/microsoft/go-mssqldb v0.17.0 h1:Fto83dMZPnYv1Zwx5vHHxpNraeEaUlQ/hhHLgZiaenE= github.com/microsoft/go-mssqldb v0.17.0/go.mod h1:OkoNGhGEs8EZqchVTtochlXruEhEOaO4S0d2sB5aeGQ= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -908,22 +905,22 @@ github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrb github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= +github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -934,8 +931,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rabbitmq/amqp091-go v1.5.0/go.mod h1:JsV0ofX5f1nwOGafb8L5rBItt9GyhfQfcJj+oyz0dGg= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk= -github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= +github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= @@ -943,8 +940,8 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= @@ -979,8 +976,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/urfave/cli/v2 v2.11.0/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -998,22 +996,30 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/zeromicro/go-zero v1.5.1/go.mod h1:bGYm4XWsGN9GhDsO2O2BngpVoWjf3Eog2a5hUOMhlXs= -github.com/zeromicro/go-zero v1.6.2 h1:c1gXp6JTO0e+dtfwNZRE7OZgzjipfW8i1iBMoBnDwBI= -github.com/zeromicro/go-zero v1.6.2/go.mod h1:mQKK/c/er/sbIAo7DWyFBZX8oa0eOkc7QJdG15b2GBw= +github.com/zeromicro/go-zero v1.6.3 h1:OL0NnHD5LdRNDolfcK9vUkJt7K8TcBE3RkzfM8poOVw= +github.com/zeromicro/go-zero v1.6.3/go.mod h1:XZL435ZxVi9MSXXtw2MRQhHgx6OoX3++MRMOE9xU70c= gitlink.org.cn/JointCloud/pcm-kubernetes v0.0.0-20240301071143-347480abff2c h1:2Wl/hvaSFjh6fmCSIQhjkr9llMRREQeqcXNLZ/HPY18= gitlink.org.cn/JointCloud/pcm-kubernetes v0.0.0-20240301071143-347480abff2c/go.mod h1:lSRfGs+PxFvw7CcndHWRd6UlLlGrZn0b0hp5cfaMNGw= -gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240302011808-94128b6ca01d h1:rCgb4C0Ur2eaq+HUY2re4PXRViFCFrzMQg9/3Tlga0A= -gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240302011808-94128b6ca01d/go.mod h1:i2rrbMQ+Fve345BY9Heh4MUqVTAimZQElQhzzRee5B8= +gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240307072630-6ff50727536a h1:EPGDZgTRz6/OXnCCgHJOMK0USDkYTP/WQGrqCUKsFm4= +gitlink.org.cn/JointCloud/pcm-openstack v0.0.0-20240307072630-6ff50727536a/go.mod h1:i2rrbMQ+Fve345BY9Heh4MUqVTAimZQElQhzzRee5B8= gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5 h1:+/5vnzkJBfMRnya1NrhOzlroUtRa5ePiYbPKlHLoLV0= gitlink.org.cn/JointCloud/pcm-slurm v0.0.0-20240301080743-8b94bbaf57f5/go.mod h1:97AlUXN13g9UN3+9/DzCHpeoU5sbdyv0IQuTEHNexzQ= gitlink.org.cn/jcce-pcm/pcm-ac v0.0.0-20240301085553-f6ad88fa357a h1:fY1KmyZ6O7wVBvgt2HB+C9e1DncJdk/Wkv8m5Qz7abw= gitlink.org.cn/jcce-pcm/pcm-ac v0.0.0-20240301085553-f6ad88fa357a/go.mod h1:oMaWf5sEDFKTfCbIlT6/7IFI3f6PsuiRnWzzQruSF5Q= +gitlink.org.cn/jcce-pcm/pcm-coordinator v0.1.19 h1:qeBcLo7NTGPsowxxgc7dD+fdWHEOZBrt1vY26+3wv+k= +gitlink.org.cn/jcce-pcm/pcm-coordinator v0.1.19/go.mod h1:0dHxKCTjH3ud1qRQZjE6EqXSs3NTOpiHWTpaip4mrWE= gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d h1:DHjl/rLuH2gKYtY0MKMGNQDHFT12APg25RlMUQo+tHk= gitlink.org.cn/jcce-pcm/pcm-participant-ceph v0.0.0-20230904090036-24fc730ec87d/go.mod h1:r/KLzUpupCV5jdxSfgDhc2pVjP0fBi3VhAWRttsBn30= +gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231214084401-de9ac5db7246 h1:VVyI1H3hRv5tDWHt41jIlrucmxF10z3bMqv/hIwCcw0= +gitlink.org.cn/jcce-pcm/pcm-participant-kubernetes v0.0.0-20231214084401-de9ac5db7246/go.mod h1:LM+XeDayimN6b1AY7AhNbbhq9HJyS0u7tszMCNsNmAo= gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20231101085149-724c7c4cc090 h1:jztlHo72bcWM1jUwvG3Hfk2K+AJL0RvlsdIqlktH/MI= gitlink.org.cn/jcce-pcm/pcm-participant-modelarts v0.0.0-20231101085149-724c7c4cc090/go.mod h1:pisJKAI8FRFFUcBaH3Gob+ENXWRM97rpuYmv9s1raag= gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20240222124813-e275cfa342f4 h1:NrxKAZ5uAzshB9EHcPw+XTOTzpxb5HslNRMYBrFC1Qo= gitlink.org.cn/jcce-pcm/pcm-participant-octopus v0.0.0-20240222124813-e275cfa342f4/go.mod h1:uyvpVqG1jHDXX+ubXI0RBwnWXzVykD/mliqGQIDvRoo= +gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231102023739-81a3d353c10d h1:hdSxVD+AN7W6j847/GsnNgOAX5IdRQRV1KLz+d4FlS0= +gitlink.org.cn/jcce-pcm/pcm-participant-openstack v0.0.0-20231102023739-81a3d353c10d/go.mod h1:m75SVNfNa1TUBlQtBfR0CeETQ0ez2RIUqlSCn1Mb/js= +gitlink.org.cn/jcce-pcm/pcm-slurm v0.0.0-20231107115628-f74106c47dfa h1:U0YV9ju5OPpUe8iUk4OEUtYJlINgpI0vgLC1IfZ2JUY= +gitlink.org.cn/jcce-pcm/pcm-slurm v0.0.0-20231107115628-f74106c47dfa/go.mod h1:tqj8GWoM2P21agWvJyUwN1U37CqfALwZTkRs9Ekgrbw= go.etcd.io/etcd/api/v3 v3.5.7/go.mod h1:9qew1gCdDDLu+VwmeG+iFpL+QlpHTo7iubavdVDgCAA= go.etcd.io/etcd/api/v3 v3.5.12 h1:W4sw5ZoU2Juc9gBWuLk5U6fHfNVyY1WC5g9uiXZio/c= go.etcd.io/etcd/api/v3 v3.5.12/go.mod h1:Ot+o0SWSyT6uHhA56al1oCED0JImsRiU9Dc26+C2a+4= @@ -1033,39 +1039,39 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= go.opentelemetry.io/otel/exporters/jaeger v1.17.0 h1:D7UpUy2Xc2wsi1Ras6V40q806WM07rqoCWzXu7Sqy+4= go.opentelemetry.io/otel/exporters/jaeger v1.17.0/go.mod h1:nPCqOnEH9rNLKqH/+rrUjiMzHJdV1BlpKcTwRTyKkKI= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0/go.mod h1:UFG7EBMRdXyFstOwH028U0sVf+AvukSGhF0g8+dmNG8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 h1:digkEZCJWobwBqMwC0cwCq8/wkkRy/OowZg5OArWZrM= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0/go.mod h1:/OpE/y70qVkndM0TrxT4KBoN3RsFZP0QaofcfYrj76I= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 h1:VhlEQAPp9R1ktYfrPk5SOryw1e9LDDTZCbIPFrho0ec= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0/go.mod h1:kB3ufRbfU+CQ4MlUcqtW8Z7YEOBeK2DJ6CmR5rYYF3E= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA= go.opentelemetry.io/otel/exporters/zipkin v1.14.0/go.mod h1:RcjvOAcvhzcufQP8aHmzRw1gE9g/VEZufDdo2w+s4sk= -go.opentelemetry.io/otel/exporters/zipkin v1.21.0 h1:D+Gv6lSfrFBWmQYyxKjDd0Zuld9SRXpIrEsKZvE4DO4= -go.opentelemetry.io/otel/exporters/zipkin v1.21.0/go.mod h1:83oMKR6DzmHisFOW3I+yIMGZUTjxiWaiBI8M8+TU5zE= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/exporters/zipkin v1.24.0 h1:3evrL5poBuh1KF51D9gO/S+N/1msnm4DaBqs/rpXUqY= +go.opentelemetry.io/otel/exporters/zipkin v1.24.0/go.mod h1:0EHgD8R0+8yRhUYJOGR8Hfg2dpiJQxDOszd5smVO9wM= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM= -go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw= +go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg= go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= -go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= -go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI= +go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= @@ -1083,8 +1089,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= +go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -1102,8 +1108,8 @@ golang.org/x/crypto v0.0.0-20221010152910-d6f0a8c073c2/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1147,8 +1153,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1220,8 +1226,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1249,8 +1255,8 @@ golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= -golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= -golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1267,8 +1273,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1367,8 +1373,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1381,8 +1387,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= -golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1473,8 +1479,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1660,12 +1666,10 @@ google.golang.org/genproto v0.0.0-20221202195650-67e5cbc046fd/go.mod h1:cTsE614G google.golang.org/genproto v0.0.0-20221207170731-23e4bf6bdc37/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= -google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= -google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 h1:8eadJkXbwDEMNwcB5O0s5Y5eCfyuCLdvaiOIaGTrWmQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 h1:IR+hp6ypxjH24bkMfEJ0yHR21+gwPWdV+/IBrPQyn3k= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1706,8 +1710,8 @@ google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= -google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0= -google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= +google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk= +google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1726,8 +1730,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.2-0.20230222093303-bc1253ad3743/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1786,28 +1790,28 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE= -k8s.io/api v0.29.1 h1:DAjwWX/9YT7NQD4INu49ROJuZAAAP/Ijki48GUPzxqw= -k8s.io/api v0.29.1/go.mod h1:7Kl10vBRUXhnQQI8YR/R327zXC8eJ7887/+Ybta+RoQ= +k8s.io/api v0.29.2 h1:hBC7B9+MU+ptchxEqTNW2DkUosJpp1P+Wn6YncZ474A= +k8s.io/api v0.29.2/go.mod h1:sdIaaKuU7P44aoyyLlikSLayT6Vb7bvJNCX105xZXY0= k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= -k8s.io/apimachinery v0.29.1 h1:KY4/E6km/wLBguvCZv8cKTeOwwOBqFNjwJIdMkMbbRc= -k8s.io/apimachinery v0.29.1/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= +k8s.io/apimachinery v0.29.2 h1:EWGpfJ856oj11C52NRCHuU7rFDwxev48z+6DSlGNsV8= +k8s.io/apimachinery v0.29.2/go.mod h1:6HVkd1FwxIagpYrHSwJlQqZI3G9LfYWRPAkUvLnXTKU= k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ= -k8s.io/client-go v0.29.1 h1:19B/+2NGEwnFLzt0uB5kNJnfTsbV8w6TgQRz9l7ti7A= -k8s.io/client-go v0.29.1/go.mod h1:TDG/psL9hdet0TI9mGyHJSgRkW3H9JZk2dNEUS7bRks= +k8s.io/client-go v0.29.2 h1:FEg85el1TeZp+/vYJM7hkDlSTFZ+c5nnK44DJ4FyoRg= +k8s.io/client-go v0.29.2/go.mod h1:knlvFZE58VpqbQpJNbCbctTVXcd35mMyAAwBdpt4jrA= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= -k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8 h1:vzKzxN5uyJZLY8HL1/OovW7BJefnsBIWt8T7Gjh2boQ= -k8s.io/kube-openapi v0.0.0-20231206194836-bf4651e18aa8/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20221107191617-1a15be271d1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= k8s.io/utils v0.0.0-20230115233650-391b47cb4029/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= -k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ= +k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 71568bc063c7d2c8439a8954aa2a5c8d82863d57 Mon Sep 17 00:00:00 2001 From: qiwang <1364512070@qq.com> Date: Fri, 8 Mar 2024 17:19:02 +0800 Subject: [PATCH 2/2] fix:Add virtual machine interfaces Former-commit-id: 42d9e804096fd76324642a8311f5f08416ea271c --- api/desc/pcm.api | 68 +++++++++---------- api/internal/handler/routes.go | 68 +++++++++---------- api/internal/logic/vm/shownodedetailslogic.go | 22 +++++- 3 files changed, 88 insertions(+), 70 deletions(-) diff --git a/api/desc/pcm.api b/api/desc/pcm.api index d97734bf..69910fb3 100644 --- a/api/desc/pcm.api +++ b/api/desc/pcm.api @@ -400,39 +400,39 @@ service pcm { @doc "取消暂停虚拟机" @handler UnpauseServerHandler - post /vm/UnpauseServer (UnpauseServerReq) returns (UnpauseServerResp) + post /vm/unpauseServer (UnpauseServerReq) returns (UnpauseServerResp) @doc "调整大小" @handler ResizeServerHandler - post /vm/ResizeServer (ResizeServerReq) returns (ResizeServerResp) + post /vm/resizeServer (ResizeServerReq) returns (ResizeServerResp) @doc "迁移" @handler MigrateServerHandler - post /vm/MigrateServer (MigrateServerReq) returns (MigrateServerResp) + post /vm/migrateServer (MigrateServerReq) returns (MigrateServerResp) @doc "搁置" @handler ShelveServerHandler - post /vm/ShelveServer (ShelveServerReq) returns (ShelveServerResp) + post /vm/shelveServer (ShelveServerReq) returns (ShelveServerResp) @doc "设置密码" @handler ChangeAdministrativePasswordHandler - post /vm/ChangeAdministrativePassword (ChangeAdministrativePasswordReq) returns (ChangeAdministrativePasswordResp) + post /vm/changeAdministrativePassword (ChangeAdministrativePasswordReq) returns (ChangeAdministrativePasswordResp) @doc "救援" @handler RescueServerHandler - post /vm/RescueServer (RescueServerReq) returns (RescueServerResp) + post /vm/rescueServer (RescueServerReq) returns (RescueServerResp) @doc "取消救援" @handler UnRescueHandler - post /vm/UnRescueServer (UnRescueServerReq) returns (UnRescueServerResp) + post /vm/unRescueServer (UnRescueServerReq) returns (UnRescueServerResp) @doc "中止" @handler SuspendServerHandler - post /vm/SuspendServer (SuspendServerReq) returns (SuspendServerResp) + post /vm/suspendServer (SuspendServerReq) returns (SuspendServerResp) @doc "将安全组添加到服务器" @handler AddSecurityGroupToServerHandler - post /vm/AddSecurityGroupToServer (AddSecurityGroupToServerReq) returns (AddSecurityGroupToServerResp) + post /vm/addSecurityGroupToServer (AddSecurityGroupToServerReq) returns (AddSecurityGroupToServerResp) @doc "从服务器中删除安全" @handler removeSecurityGroupHandler @@ -440,11 +440,11 @@ service pcm { @doc "创建规格" @handler CreateFlavorHandler - post /vm/CreateFlavor (CreateFlavorReq) returns (CreateFlavorResp) + post /vm/createFlavor (CreateFlavorReq) returns (CreateFlavorResp) @doc "创建规格" @handler DeleteFlavorHandler - post /vm/DeleteFlavor (DeleteFlavorReq) returns (DeleteFlavorResp) + post /vm/deleteFlavor (DeleteFlavorReq) returns (DeleteFlavorResp) @doc "查询镜像列表" @handler ListImagesHandler @@ -568,7 +568,7 @@ service pcm { @doc "查询浮动ip列表" @handler ListFloatingIPsHandler - get /vm/ListFloatingIPs (ListFloatingIPsReq) returns (ListFloatingIPsResp) + get /vm/listFloatingIPs (ListFloatingIPsReq) returns (ListFloatingIPsResp) @doc "删除浮动ip" @handler DeleteFloatingIPHandler @@ -584,91 +584,91 @@ service pcm { @doc "创建防火墙" @handler CreateFirewallGroupHandler - post /vm/CreateFirewallGroup (CreateFirewallGroupReq) returns (CreateFirewallGroupResp) + post /vm/createFirewallGroup (CreateFirewallGroupReq) returns (CreateFirewallGroupResp) @doc "查询防火墙列表" @handler ListFirewallGroupsHandler - get /vm/ListFirewallGroups (ListFirewallGroupsReq) returns (ListFirewallGroupsResp) + get /vm/listFirewallGroups (ListFirewallGroupsReq) returns (ListFirewallGroupsResp) @doc "删除防火墙" @handler DeleteFirewallGroupHandler - delete /vm/DeleteFirewallGroup (DeleteFirewallGroupReq) returns (DeleteFirewallGroupResp) + delete /vm/deleteFirewallGroup (DeleteFirewallGroupReq) returns (DeleteFirewallGroupResp) @doc "修改防火墙" @handler UpdateFirewallGroupHandler - put /vm/UpdateFirewallGroup (UpdateFirewallGroupReq) returns (UpdateFirewallGroupResp) + put /vm/updateFirewallGroup (UpdateFirewallGroupReq) returns (UpdateFirewallGroupResp) @doc "查询防火墙详情" @handler ShowFirewallGroupDetailsHandler - get /vm/ShowFirewallGroupDetails (ShowFirewallGroupDetailsReq) returns (ShowFirewallGroupDetailsResp) + get /vm/showFirewallGroupDetails (ShowFirewallGroupDetailsReq) returns (ShowFirewallGroupDetailsResp) @doc "创建防火墙策略" @handler CreateFirewallPolicyHandler - post /vm/CreateFirewallPolicy (CreateFirewallPolicyReq) returns (CreateFirewallPolicyResp) + post /vm/createFirewallPolicy (CreateFirewallPolicyReq) returns (CreateFirewallPolicyResp) @doc "查询防火墙策略列表" @handler ListFirewallPoliciesHandler - get /vm/ListFirewallPolicies (ListFirewallPoliciesReq) returns (ListFirewallPoliciesResp) + get /vm/listFirewallPolicies (ListFirewallPoliciesReq) returns (ListFirewallPoliciesResp) @doc "删除防火墙策略" @handler DeleteFirewallPolicyHandler - delete /vm/DeleteFirewallPolicy (DeleteFirewallPolicyReq) returns (DeleteFirewallPolicyResp) + delete /vm/deleteFirewallPolicy (DeleteFirewallPolicyReq) returns (DeleteFirewallPolicyResp) @doc "查询防火墙策略详情" @handler ShowFirewallRuleDetailsHandler - get /vm/ShowFirewallRuleDetails (ShowFirewallRuleDetailsReq) returns (ShowFirewallRuleDetailsResp) + get /vm/showFirewallRuleDetails (ShowFirewallRuleDetailsReq) returns (ShowFirewallRuleDetailsResp) @doc "查询防火墙策略详情" @handler ShowFirewallPolicyDetailsHandler - get /vm/ShowFirewallPolicyDetails (ShowFirewallPolicyDetailsReq) returns (ShowFirewallPolicyDetailsResp) + get /vm/showFirewallPolicyDetails (ShowFirewallPolicyDetailsReq) returns (ShowFirewallPolicyDetailsResp) @doc "创建防火墙策略" @handler CreateFirewallRuleHandler - post /vm/CreateFirewallRule (CreateFirewallRuleReq) returns (CreateFirewallRuleResp) + post /vm/createFirewallRule (CreateFirewallRuleReq) returns (CreateFirewallRuleResp) @doc "查询防火墙策略列表" @handler ListFirewallRulesHandler - get /vm/ListFirewallRules (ListFirewallRulesReq) returns (ListFirewallRulesResp) + get /vm/listFirewallRules (ListFirewallRulesReq) returns (ListFirewallRulesResp) @doc "删除防火墙策略" @handler DeleteFirewallRuleHandler - delete /vm/DeleteFirewallRule (DeleteFirewallRuleReq) returns (DeleteFirewallRuleResp) + delete /vm/deleteFirewallRule (DeleteFirewallRuleReq) returns (DeleteFirewallRuleResp) @doc "创建安全组" @handler CreateSecurityGroupHandler - post /vm/CreateSecurityGroup (CreateSecurityGroupReq) returns (CreateSecurityGroupResp) + post /vm/createSecurityGroup (CreateSecurityGroupReq) returns (CreateSecurityGroupResp) @doc "查询安全组列表" @handler ListSecurityGroupsHandler - get /vm/ListSecurityGroups (ListSecurityGroupsReq) returns (ListSecurityGroupsResp) + get /vm/listSecurityGroups (ListSecurityGroupsReq) returns (ListSecurityGroupsResp) @doc "删除安全组" @handler DeleteSecurityGroupHandler - delete /vm/DeleteSecurityGroup (DeleteSecurityGroupReq) returns (DeleteSecurityGroupResp) + delete /vm/deleteSecurityGroup (DeleteSecurityGroupReq) returns (DeleteSecurityGroupResp) @doc "修改安全组" @handler UpdateSecurityGroupHandler - put /vm/UpdateSecurityGroup (UpdateSecurityGroupReq) returns (UpdateSecurityGroupResp) + put /vm/updateSecurityGroup (UpdateSecurityGroupReq) returns (UpdateSecurityGroupResp) @doc "查询安全组详情" @handler ShowSecurityGroupHandler - get /vm/ShowSecurityGroup (ShowSecurityGroupReq) returns (ShowSecurityGroupResp) + get /vm/showSecurityGroup (ShowSecurityGroupReq) returns (ShowSecurityGroupResp) @doc "创建安全组规则" @handler CreateSecurityGroupRuleHandler - post /vm/CreateSecurityGroupRule (CreateSecurityGroupRuleReq) returns (CreateSecurityGroupRuleResp) + post /vm/createSecurityGroupRule (CreateSecurityGroupRuleReq) returns (CreateSecurityGroupRuleResp) @doc "查询安全组规则列表" @handler ListSecurityGroupRulesHandler - get /vm/ListSecurityGroupRules (ListSecurityGroupRulesReq) returns (ListSecurityGroupRulesResp) + get /vm/listSecurityGroupRules (ListSecurityGroupRulesReq) returns (ListSecurityGroupRulesResp) @doc "删除安全组规则" @handler DeleteSecurityGroupRuleHandler - delete /vm/DeleteSecurityGroupRule (DeleteSecurityGroupRuleReq) returns (DeleteSecurityGroupRuleResp) + delete /vm/deleteSecurityGroupRule (DeleteSecurityGroupRuleReq) returns (DeleteSecurityGroupRuleResp) @doc "查询安全组规则详情" @handler ShowSecurityGroupRuleHandler - get /vm/ShowSecurityGroupRule (ShowSecurityGroupRuleReq) returns (ShowSecurityGroupRuleResp) + get /vm/showSecurityGroupRule (ShowSecurityGroupRuleReq) returns (ShowSecurityGroupRuleResp) @doc "查询卷详情列表" @handler ListVolumesDetailHandler diff --git a/api/internal/handler/routes.go b/api/internal/handler/routes.go index 7d2cb6a4..decfc7b4 100644 --- a/api/internal/handler/routes.go +++ b/api/internal/handler/routes.go @@ -471,47 +471,47 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { Method: http.MethodPost, - Path: "/vm/UnpauseServer", + Path: "/vm/unpauseServer", Handler: vm.UnpauseServerHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/ResizeServer", + Path: "/vm/resizeServer", Handler: vm.ResizeServerHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/MigrateServer", + Path: "/vm/migrateServer", Handler: vm.MigrateServerHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/ShelveServer", + Path: "/vm/shelveServer", Handler: vm.ShelveServerHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/ChangeAdministrativePassword", + Path: "/vm/changeAdministrativePassword", Handler: vm.ChangeAdministrativePasswordHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/RescueServer", + Path: "/vm/rescueServer", Handler: vm.RescueServerHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/UnRescueServer", + Path: "/vm/unRescueServer", Handler: vm.UnRescueHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/SuspendServer", + Path: "/vm/suspendServer", Handler: vm.SuspendServerHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/AddSecurityGroupToServer", + Path: "/vm/addSecurityGroupToServer", Handler: vm.AddSecurityGroupToServerHandler(serverCtx), }, { @@ -521,12 +521,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { Method: http.MethodPost, - Path: "/vm/CreateFlavor", + Path: "/vm/createFlavor", Handler: vm.CreateFlavorHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/DeleteFlavor", + Path: "/vm/deleteFlavor", Handler: vm.DeleteFlavorHandler(serverCtx), }, { @@ -681,7 +681,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { Method: http.MethodGet, - Path: "/vm/ListFloatingIPs", + Path: "/vm/listFloatingIPs", Handler: vm.ListFloatingIPsHandler(serverCtx), }, { @@ -701,112 +701,112 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { }, { Method: http.MethodPost, - Path: "/vm/CreateFirewallGroup", + Path: "/vm/createFirewallGroup", Handler: vm.CreateFirewallGroupHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ListFirewallGroups", + Path: "/vm/listFirewallGroups", Handler: vm.ListFirewallGroupsHandler(serverCtx), }, { Method: http.MethodDelete, - Path: "/vm/DeleteFirewallGroup", + Path: "/vm/deleteFirewallGroup", Handler: vm.DeleteFirewallGroupHandler(serverCtx), }, { Method: http.MethodPut, - Path: "/vm/UpdateFirewallGroup", + Path: "/vm/updateFirewallGroup", Handler: vm.UpdateFirewallGroupHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ShowFirewallGroupDetails", + Path: "/vm/showFirewallGroupDetails", Handler: vm.ShowFirewallGroupDetailsHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/CreateFirewallPolicy", + Path: "/vm/createFirewallPolicy", Handler: vm.CreateFirewallPolicyHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ListFirewallPolicies", + Path: "/vm/listFirewallPolicies", Handler: vm.ListFirewallPoliciesHandler(serverCtx), }, { Method: http.MethodDelete, - Path: "/vm/DeleteFirewallPolicy", + Path: "/vm/deleteFirewallPolicy", Handler: vm.DeleteFirewallPolicyHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ShowFirewallRuleDetails", + Path: "/vm/showFirewallRuleDetails", Handler: vm.ShowFirewallRuleDetailsHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ShowFirewallPolicyDetails", + Path: "/vm/showFirewallPolicyDetails", Handler: vm.ShowFirewallPolicyDetailsHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/CreateFirewallRule", + Path: "/vm/createFirewallRule", Handler: vm.CreateFirewallRuleHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ListFirewallRules", + Path: "/vm/listFirewallRules", Handler: vm.ListFirewallRulesHandler(serverCtx), }, { Method: http.MethodDelete, - Path: "/vm/DeleteFirewallRule", + Path: "/vm/deleteFirewallRule", Handler: vm.DeleteFirewallRuleHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/CreateSecurityGroup", + Path: "/vm/createSecurityGroup", Handler: vm.CreateSecurityGroupHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ListSecurityGroups", + Path: "/vm/listSecurityGroups", Handler: vm.ListSecurityGroupsHandler(serverCtx), }, { Method: http.MethodDelete, - Path: "/vm/DeleteSecurityGroup", + Path: "/vm/deleteSecurityGroup", Handler: vm.DeleteSecurityGroupHandler(serverCtx), }, { Method: http.MethodPut, - Path: "/vm/UpdateSecurityGroup", + Path: "/vm/updateSecurityGroup", Handler: vm.UpdateSecurityGroupHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ShowSecurityGroup", + Path: "/vm/showSecurityGroup", Handler: vm.ShowSecurityGroupHandler(serverCtx), }, { Method: http.MethodPost, - Path: "/vm/CreateSecurityGroupRule", + Path: "/vm/createSecurityGroupRule", Handler: vm.CreateSecurityGroupRuleHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ListSecurityGroupRules", + Path: "/vm/listSecurityGroupRules", Handler: vm.ListSecurityGroupRulesHandler(serverCtx), }, { Method: http.MethodDelete, - Path: "/vm/DeleteSecurityGroupRule", + Path: "/vm/deleteSecurityGroupRule", Handler: vm.DeleteSecurityGroupRuleHandler(serverCtx), }, { Method: http.MethodGet, - Path: "/vm/ShowSecurityGroupRule", + Path: "/vm/showSecurityGroupRule", Handler: vm.ShowSecurityGroupRuleHandler(serverCtx), }, { diff --git a/api/internal/logic/vm/shownodedetailslogic.go b/api/internal/logic/vm/shownodedetailslogic.go index bfa71520..6b29d9e1 100644 --- a/api/internal/logic/vm/shownodedetailslogic.go +++ b/api/internal/logic/vm/shownodedetailslogic.go @@ -16,6 +16,13 @@ package vm import ( "context" + "github.com/jinzhu/copier" + "github.com/pkg/errors" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/helper/xerr" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" + "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils" + "gitlink.org.cn/JointCloud/pcm-openstack/openstack" + "k8s.io/apimachinery/pkg/util/json" "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" @@ -39,6 +46,17 @@ func NewShowNodeDetailsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *S func (l *ShowNodeDetailsLogic) ShowNodeDetails(req *types.ShowNodeDetailsReq) (resp *types.ShowNodeDetailsResp, err error) { // todo: add your logic here and delete this line - - return + ShowNodeDetailsReq := &openstack.ShowNodeDetailsReq{} + err = copier.CopyWithOption(ShowNodeDetailsReq, req, copier.Option{Converters: utils.Converters}) + ShowNodeDetailsResp, err := l.svcCtx.OpenstackRpc.ShowNodeDetails(l.ctx, ShowNodeDetailsReq) + if err != nil { + return nil, errors.Wrapf(xerr.NewErrMsg("c端创建失败"), "c端创建失败 : %v ,req:%+v", err, req) + } + marshal, err := json.Marshal(&ShowNodeDetailsResp) + if err != nil { + return nil, result.NewDefaultError(err.Error()) + } + json.Unmarshal(marshal, &resp) + err = copier.CopyWithOption(&resp, &ShowNodeDetailsResp, copier.Option{Converters: utils.Converters}) + return resp, err }