rpyc-pve-cloud 0.1.7rc0__py3-none-any.whl → 0.2.0rc0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pve_cloud_rpc/_version.py +1 -1
- pve_cloud_rpc/protos/cloud_pb2.py +61 -25
- pve_cloud_rpc/protos/cloud_pb2_grpc.py +301 -0
- pve_cloud_rpc/server.py +163 -4
- {rpyc_pve_cloud-0.1.7rc0.dist-info → rpyc_pve_cloud-0.2.0rc0.dist-info}/METADATA +2 -2
- rpyc_pve_cloud-0.2.0rc0.dist-info/RECORD +12 -0
- {rpyc_pve_cloud-0.1.7rc0.dist-info → rpyc_pve_cloud-0.2.0rc0.dist-info}/WHEEL +1 -1
- rpyc_pve_cloud-0.1.7rc0.dist-info/RECORD +0 -12
- {rpyc_pve_cloud-0.1.7rc0.dist-info → rpyc_pve_cloud-0.2.0rc0.dist-info}/entry_points.txt +0 -0
- {rpyc_pve_cloud-0.1.7rc0.dist-info → rpyc_pve_cloud-0.2.0rc0.dist-info}/licenses/LICENSE.md +0 -0
- {rpyc_pve_cloud-0.1.7rc0.dist-info → rpyc_pve_cloud-0.2.0rc0.dist-info}/top_level.txt +0 -0
pve_cloud_rpc/_version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.2.0-rc0"
|
|
@@ -24,7 +24,7 @@ _sym_db = _symbol_database.Default()
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x63loud.proto\x12\x06protos\",\n\x16GetPveInventoryRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"B\n\x17GetPveInventoryResponse\x12\x11\n\tinventory\x18\x01 \x01(\t\x12\x14\n\x0c\x63loud_domain\x18\x02 \x01(\t\"+\n\x15GetProxmoxHostRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"*\n\x16GetProxmoxHostResponse\x12\x10\n\x08pve_host\x18\x01 \x01(\t\"\xa9\x01\n\x14GetProxmoxApiRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x10\n\x08\x61pi_path\x18\x02 \x01(\t\x12;\n\x08get_args\x18\x03 \x03(\x0b\x32).protos.GetProxmoxApiRequest.GetArgsEntry\x1a.\n\x0cGetArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x15GetProxmoxApiResponse\x12\x11\n\tjson_resp\x18\x01 \x01(\t\"\x87\x01\n\x10GetSshKeyRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x32\n\x08key_type\x18\x02 \x01(\x0e\x32 .protos.GetSshKeyRequest.KeyType\"+\n\x07KeyType\x12\x0e\n\nAUTOMATION\x10\x00\x12\x10\n\x0cPVE_HOST_RSA\x10\x01\" \n\x11GetSshKeyResponse\x12\x0b\n\x03key\x18\x01 \x01(\t\"*\n\x14GetCephAccessRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"A\n\x15GetCephAccessResponse\x12\x11\n\tceph_conf\x18\x01 \x01(\t\x12\x15\n\radmin_keyring\x18\x02 \x01(\t\">\n\x14GetKubeconfigRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x12\n\nstack_name\x18\x02 \x01(\t\"\'\n\x15GetKubeconfigResponse\x12\x0e\n\x06\x63onfig\x18\x01 \x01(\t\"+\n\x15GetClusterVarsRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"&\n\x16GetClusterVarsResponse\x12\x0c\n\x04vars\x18\x01 \x01(\t\"
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x63loud.proto\x12\x06protos\",\n\x16GetPveInventoryRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"B\n\x17GetPveInventoryResponse\x12\x11\n\tinventory\x18\x01 \x01(\t\x12\x14\n\x0c\x63loud_domain\x18\x02 \x01(\t\"+\n\x15GetProxmoxHostRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"*\n\x16GetProxmoxHostResponse\x12\x10\n\x08pve_host\x18\x01 \x01(\t\"\xa9\x01\n\x14GetProxmoxApiRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x10\n\x08\x61pi_path\x18\x02 \x01(\t\x12;\n\x08get_args\x18\x03 \x03(\x0b\x32).protos.GetProxmoxApiRequest.GetArgsEntry\x1a.\n\x0cGetArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x15GetProxmoxApiResponse\x12\x11\n\tjson_resp\x18\x01 \x01(\t\"\xb8\x01\n\x17\x43reateProxmoxApiRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x10\n\x08\x61pi_path\x18\x02 \x01(\t\x12\x44\n\x0b\x63reate_args\x18\x03 \x03(\x0b\x32/.protos.CreateProxmoxApiRequest.CreateArgsEntry\x1a\x31\n\x0f\x43reateArgsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"@\n\x18\x43reateProxmoxApiResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x13\n\x0b\x65rr_message\x18\x02 \x01(\t\"?\n\x17\x44\x65leteProxmoxApiRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x10\n\x08\x61pi_path\x18\x02 \x01(\t\"@\n\x18\x44\x65leteProxmoxApiResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x13\n\x0b\x65rr_message\x18\x02 \x01(\t\"\x87\x01\n\x10GetSshKeyRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x32\n\x08key_type\x18\x02 \x01(\x0e\x32 .protos.GetSshKeyRequest.KeyType\"+\n\x07KeyType\x12\x0e\n\nAUTOMATION\x10\x00\x12\x10\n\x0cPVE_HOST_RSA\x10\x01\" \n\x11GetSshKeyResponse\x12\x0b\n\x03key\x18\x01 \x01(\t\"*\n\x14GetCephAccessRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"A\n\x15GetCephAccessResponse\x12\x11\n\tceph_conf\x18\x01 \x01(\t\x12\x15\n\radmin_keyring\x18\x02 \x01(\t\">\n\x14GetKubeconfigRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x12\n\nstack_name\x18\x02 \x01(\t\"\'\n\x15GetKubeconfigResponse\x12\x0e\n\x06\x63onfig\x18\x01 \x01(\t\"+\n\x15GetClusterVarsRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"&\n\x16GetClusterVarsResponse\x12\x0c\n\x04vars\x18\x01 \x01(\t\"T\n\x19GetCloudFileSecretRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x13\n\x0bsecret_name\x18\x02 \x01(\t\x12\x0e\n\x06rstrip\x18\x03 \x01(\x08\",\n\x1aGetCloudFileSecretResponse\x12\x0e\n\x06secret\x18\x01 \x01(\t\"m\n\x18\x43reateCloudSecretRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x13\n\x0bsecret_name\x18\x02 \x01(\t\x12\x13\n\x0bsecret_data\x18\x03 \x01(\t\x12\x13\n\x0bsecret_type\x18\x04 \x01(\t\"A\n\x19\x43reateCloudSecretResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x13\n\x0b\x65rr_message\x18\x02 \x01(\t\"C\n\x18\x44\x65leteCloudSecretRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x13\n\x0bsecret_name\x18\x02 \x01(\t\"A\n\x19\x44\x65leteCloudSecretResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x13\n\x0b\x65rr_message\x18\x02 \x01(\t\"@\n\x15GetCloudSecretRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x13\n\x0bsecret_name\x18\x02 \x01(\t\"(\n\x16GetCloudSecretResponse\x12\x0e\n\x06secret\x18\x01 \x01(\t\"A\n\x16GetCloudSecretsRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x13\n\x0bsecret_type\x18\x02 \x01(\t\"*\n\x17GetCloudSecretsResponse\x12\x0f\n\x07secrets\x18\x01 \x01(\t\">\n\x15GetVmVarsBlakeRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\x12\x11\n\tblake_ids\x18\x02 \x03(\t\"\x94\x01\n\x16GetVmVarsBlakeResponse\x12\x46\n\rblake_id_vars\x18\x01 \x03(\x0b\x32/.protos.GetVmVarsBlakeResponse.BlakeIdVarsEntry\x1a\x32\n\x10\x42lakeIdVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x32\xeb\t\n\x0c\x43loudService\x12R\n\x13GetMasterKubeconfig\x12\x1c.protos.GetKubeconfigRequest\x1a\x1d.protos.GetKubeconfigResponse\x12O\n\x0eGetClusterVars\x12\x1d.protos.GetClusterVarsRequest\x1a\x1e.protos.GetClusterVarsResponse\x12[\n\x12GetCloudFileSecret\x12!.protos.GetCloudFileSecretRequest\x1a\".protos.GetCloudFileSecretResponse\x12X\n\x11\x43reateCloudSecret\x12 .protos.CreateCloudSecretRequest\x1a!.protos.CreateCloudSecretResponse\x12X\n\x11\x44\x65leteCloudSecret\x12 .protos.DeleteCloudSecretRequest\x1a!.protos.DeleteCloudSecretResponse\x12O\n\x0eGetCloudSecret\x12\x1d.protos.GetCloudSecretRequest\x1a\x1e.protos.GetCloudSecretResponse\x12R\n\x0fGetCloudSecrets\x12\x1e.protos.GetCloudSecretsRequest\x1a\x1f.protos.GetCloudSecretsResponse\x12L\n\rGetCephAccess\x12\x1c.protos.GetCephAccessRequest\x1a\x1d.protos.GetCephAccessResponse\x12@\n\tGetSshKey\x12\x18.protos.GetSshKeyRequest\x1a\x19.protos.GetSshKeyResponse\x12L\n\rGetProxmoxApi\x12\x1c.protos.GetProxmoxApiRequest\x1a\x1d.protos.GetProxmoxApiResponse\x12U\n\x10\x43reateProxmoxApi\x12\x1f.protos.CreateProxmoxApiRequest\x1a .protos.CreateProxmoxApiResponse\x12U\n\x10\x44\x65leteProxmoxApi\x12\x1f.protos.DeleteProxmoxApiRequest\x1a .protos.DeleteProxmoxApiResponse\x12O\n\x0eGetProxmoxHost\x12\x1d.protos.GetProxmoxHostRequest\x1a\x1e.protos.GetProxmoxHostResponse\x12R\n\x0fGetPveInventory\x12\x1e.protos.GetPveInventoryRequest\x1a\x1f.protos.GetPveInventoryResponse\x12O\n\x0eGetVmVarsBlake\x12\x1d.protos.GetVmVarsBlakeRequest\x1a\x1e.protos.GetVmVarsBlakeResponseBQZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protosb\x06proto3')
|
|
28
28
|
|
|
29
29
|
_globals = globals()
|
|
30
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -34,6 +34,10 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
34
34
|
_globals['DESCRIPTOR']._serialized_options = b'ZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protos'
|
|
35
35
|
_globals['_GETPROXMOXAPIREQUEST_GETARGSENTRY']._loaded_options = None
|
|
36
36
|
_globals['_GETPROXMOXAPIREQUEST_GETARGSENTRY']._serialized_options = b'8\001'
|
|
37
|
+
_globals['_CREATEPROXMOXAPIREQUEST_CREATEARGSENTRY']._loaded_options = None
|
|
38
|
+
_globals['_CREATEPROXMOXAPIREQUEST_CREATEARGSENTRY']._serialized_options = b'8\001'
|
|
39
|
+
_globals['_GETVMVARSBLAKERESPONSE_BLAKEIDVARSENTRY']._loaded_options = None
|
|
40
|
+
_globals['_GETVMVARSBLAKERESPONSE_BLAKEIDVARSENTRY']._serialized_options = b'8\001'
|
|
37
41
|
_globals['_GETPVEINVENTORYREQUEST']._serialized_start=23
|
|
38
42
|
_globals['_GETPVEINVENTORYREQUEST']._serialized_end=67
|
|
39
43
|
_globals['_GETPVEINVENTORYRESPONSE']._serialized_start=69
|
|
@@ -48,28 +52,60 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
48
52
|
_globals['_GETPROXMOXAPIREQUEST_GETARGSENTRY']._serialized_end=396
|
|
49
53
|
_globals['_GETPROXMOXAPIRESPONSE']._serialized_start=398
|
|
50
54
|
_globals['_GETPROXMOXAPIRESPONSE']._serialized_end=440
|
|
51
|
-
_globals['
|
|
52
|
-
_globals['
|
|
53
|
-
_globals['
|
|
54
|
-
_globals['
|
|
55
|
-
_globals['
|
|
56
|
-
_globals['
|
|
57
|
-
_globals['
|
|
58
|
-
_globals['
|
|
59
|
-
_globals['
|
|
60
|
-
_globals['
|
|
61
|
-
_globals['
|
|
62
|
-
_globals['
|
|
63
|
-
_globals['
|
|
64
|
-
_globals['
|
|
65
|
-
_globals['
|
|
66
|
-
_globals['
|
|
67
|
-
_globals['
|
|
68
|
-
_globals['
|
|
69
|
-
_globals['
|
|
70
|
-
_globals['
|
|
71
|
-
_globals['
|
|
72
|
-
_globals['
|
|
73
|
-
_globals['
|
|
74
|
-
_globals['
|
|
55
|
+
_globals['_CREATEPROXMOXAPIREQUEST']._serialized_start=443
|
|
56
|
+
_globals['_CREATEPROXMOXAPIREQUEST']._serialized_end=627
|
|
57
|
+
_globals['_CREATEPROXMOXAPIREQUEST_CREATEARGSENTRY']._serialized_start=578
|
|
58
|
+
_globals['_CREATEPROXMOXAPIREQUEST_CREATEARGSENTRY']._serialized_end=627
|
|
59
|
+
_globals['_CREATEPROXMOXAPIRESPONSE']._serialized_start=629
|
|
60
|
+
_globals['_CREATEPROXMOXAPIRESPONSE']._serialized_end=693
|
|
61
|
+
_globals['_DELETEPROXMOXAPIREQUEST']._serialized_start=695
|
|
62
|
+
_globals['_DELETEPROXMOXAPIREQUEST']._serialized_end=758
|
|
63
|
+
_globals['_DELETEPROXMOXAPIRESPONSE']._serialized_start=760
|
|
64
|
+
_globals['_DELETEPROXMOXAPIRESPONSE']._serialized_end=824
|
|
65
|
+
_globals['_GETSSHKEYREQUEST']._serialized_start=827
|
|
66
|
+
_globals['_GETSSHKEYREQUEST']._serialized_end=962
|
|
67
|
+
_globals['_GETSSHKEYREQUEST_KEYTYPE']._serialized_start=919
|
|
68
|
+
_globals['_GETSSHKEYREQUEST_KEYTYPE']._serialized_end=962
|
|
69
|
+
_globals['_GETSSHKEYRESPONSE']._serialized_start=964
|
|
70
|
+
_globals['_GETSSHKEYRESPONSE']._serialized_end=996
|
|
71
|
+
_globals['_GETCEPHACCESSREQUEST']._serialized_start=998
|
|
72
|
+
_globals['_GETCEPHACCESSREQUEST']._serialized_end=1040
|
|
73
|
+
_globals['_GETCEPHACCESSRESPONSE']._serialized_start=1042
|
|
74
|
+
_globals['_GETCEPHACCESSRESPONSE']._serialized_end=1107
|
|
75
|
+
_globals['_GETKUBECONFIGREQUEST']._serialized_start=1109
|
|
76
|
+
_globals['_GETKUBECONFIGREQUEST']._serialized_end=1171
|
|
77
|
+
_globals['_GETKUBECONFIGRESPONSE']._serialized_start=1173
|
|
78
|
+
_globals['_GETKUBECONFIGRESPONSE']._serialized_end=1212
|
|
79
|
+
_globals['_GETCLUSTERVARSREQUEST']._serialized_start=1214
|
|
80
|
+
_globals['_GETCLUSTERVARSREQUEST']._serialized_end=1257
|
|
81
|
+
_globals['_GETCLUSTERVARSRESPONSE']._serialized_start=1259
|
|
82
|
+
_globals['_GETCLUSTERVARSRESPONSE']._serialized_end=1297
|
|
83
|
+
_globals['_GETCLOUDFILESECRETREQUEST']._serialized_start=1299
|
|
84
|
+
_globals['_GETCLOUDFILESECRETREQUEST']._serialized_end=1383
|
|
85
|
+
_globals['_GETCLOUDFILESECRETRESPONSE']._serialized_start=1385
|
|
86
|
+
_globals['_GETCLOUDFILESECRETRESPONSE']._serialized_end=1429
|
|
87
|
+
_globals['_CREATECLOUDSECRETREQUEST']._serialized_start=1431
|
|
88
|
+
_globals['_CREATECLOUDSECRETREQUEST']._serialized_end=1540
|
|
89
|
+
_globals['_CREATECLOUDSECRETRESPONSE']._serialized_start=1542
|
|
90
|
+
_globals['_CREATECLOUDSECRETRESPONSE']._serialized_end=1607
|
|
91
|
+
_globals['_DELETECLOUDSECRETREQUEST']._serialized_start=1609
|
|
92
|
+
_globals['_DELETECLOUDSECRETREQUEST']._serialized_end=1676
|
|
93
|
+
_globals['_DELETECLOUDSECRETRESPONSE']._serialized_start=1678
|
|
94
|
+
_globals['_DELETECLOUDSECRETRESPONSE']._serialized_end=1743
|
|
95
|
+
_globals['_GETCLOUDSECRETREQUEST']._serialized_start=1745
|
|
96
|
+
_globals['_GETCLOUDSECRETREQUEST']._serialized_end=1809
|
|
97
|
+
_globals['_GETCLOUDSECRETRESPONSE']._serialized_start=1811
|
|
98
|
+
_globals['_GETCLOUDSECRETRESPONSE']._serialized_end=1851
|
|
99
|
+
_globals['_GETCLOUDSECRETSREQUEST']._serialized_start=1853
|
|
100
|
+
_globals['_GETCLOUDSECRETSREQUEST']._serialized_end=1918
|
|
101
|
+
_globals['_GETCLOUDSECRETSRESPONSE']._serialized_start=1920
|
|
102
|
+
_globals['_GETCLOUDSECRETSRESPONSE']._serialized_end=1962
|
|
103
|
+
_globals['_GETVMVARSBLAKEREQUEST']._serialized_start=1964
|
|
104
|
+
_globals['_GETVMVARSBLAKEREQUEST']._serialized_end=2026
|
|
105
|
+
_globals['_GETVMVARSBLAKERESPONSE']._serialized_start=2029
|
|
106
|
+
_globals['_GETVMVARSBLAKERESPONSE']._serialized_end=2177
|
|
107
|
+
_globals['_GETVMVARSBLAKERESPONSE_BLAKEIDVARSENTRY']._serialized_start=2127
|
|
108
|
+
_globals['_GETVMVARSBLAKERESPONSE_BLAKEIDVARSENTRY']._serialized_end=2177
|
|
109
|
+
_globals['_CLOUDSERVICE']._serialized_start=2180
|
|
110
|
+
_globals['_CLOUDSERVICE']._serialized_end=3439
|
|
75
111
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -44,11 +44,31 @@ class CloudServiceStub(object):
|
|
|
44
44
|
request_serializer=cloud__pb2.GetClusterVarsRequest.SerializeToString,
|
|
45
45
|
response_deserializer=cloud__pb2.GetClusterVarsResponse.FromString,
|
|
46
46
|
_registered_method=True)
|
|
47
|
+
self.GetCloudFileSecret = channel.unary_unary(
|
|
48
|
+
'/protos.CloudService/GetCloudFileSecret',
|
|
49
|
+
request_serializer=cloud__pb2.GetCloudFileSecretRequest.SerializeToString,
|
|
50
|
+
response_deserializer=cloud__pb2.GetCloudFileSecretResponse.FromString,
|
|
51
|
+
_registered_method=True)
|
|
52
|
+
self.CreateCloudSecret = channel.unary_unary(
|
|
53
|
+
'/protos.CloudService/CreateCloudSecret',
|
|
54
|
+
request_serializer=cloud__pb2.CreateCloudSecretRequest.SerializeToString,
|
|
55
|
+
response_deserializer=cloud__pb2.CreateCloudSecretResponse.FromString,
|
|
56
|
+
_registered_method=True)
|
|
57
|
+
self.DeleteCloudSecret = channel.unary_unary(
|
|
58
|
+
'/protos.CloudService/DeleteCloudSecret',
|
|
59
|
+
request_serializer=cloud__pb2.DeleteCloudSecretRequest.SerializeToString,
|
|
60
|
+
response_deserializer=cloud__pb2.DeleteCloudSecretResponse.FromString,
|
|
61
|
+
_registered_method=True)
|
|
47
62
|
self.GetCloudSecret = channel.unary_unary(
|
|
48
63
|
'/protos.CloudService/GetCloudSecret',
|
|
49
64
|
request_serializer=cloud__pb2.GetCloudSecretRequest.SerializeToString,
|
|
50
65
|
response_deserializer=cloud__pb2.GetCloudSecretResponse.FromString,
|
|
51
66
|
_registered_method=True)
|
|
67
|
+
self.GetCloudSecrets = channel.unary_unary(
|
|
68
|
+
'/protos.CloudService/GetCloudSecrets',
|
|
69
|
+
request_serializer=cloud__pb2.GetCloudSecretsRequest.SerializeToString,
|
|
70
|
+
response_deserializer=cloud__pb2.GetCloudSecretsResponse.FromString,
|
|
71
|
+
_registered_method=True)
|
|
52
72
|
self.GetCephAccess = channel.unary_unary(
|
|
53
73
|
'/protos.CloudService/GetCephAccess',
|
|
54
74
|
request_serializer=cloud__pb2.GetCephAccessRequest.SerializeToString,
|
|
@@ -64,6 +84,16 @@ class CloudServiceStub(object):
|
|
|
64
84
|
request_serializer=cloud__pb2.GetProxmoxApiRequest.SerializeToString,
|
|
65
85
|
response_deserializer=cloud__pb2.GetProxmoxApiResponse.FromString,
|
|
66
86
|
_registered_method=True)
|
|
87
|
+
self.CreateProxmoxApi = channel.unary_unary(
|
|
88
|
+
'/protos.CloudService/CreateProxmoxApi',
|
|
89
|
+
request_serializer=cloud__pb2.CreateProxmoxApiRequest.SerializeToString,
|
|
90
|
+
response_deserializer=cloud__pb2.CreateProxmoxApiResponse.FromString,
|
|
91
|
+
_registered_method=True)
|
|
92
|
+
self.DeleteProxmoxApi = channel.unary_unary(
|
|
93
|
+
'/protos.CloudService/DeleteProxmoxApi',
|
|
94
|
+
request_serializer=cloud__pb2.DeleteProxmoxApiRequest.SerializeToString,
|
|
95
|
+
response_deserializer=cloud__pb2.DeleteProxmoxApiResponse.FromString,
|
|
96
|
+
_registered_method=True)
|
|
67
97
|
self.GetProxmoxHost = channel.unary_unary(
|
|
68
98
|
'/protos.CloudService/GetProxmoxHost',
|
|
69
99
|
request_serializer=cloud__pb2.GetProxmoxHostRequest.SerializeToString,
|
|
@@ -74,6 +104,11 @@ class CloudServiceStub(object):
|
|
|
74
104
|
request_serializer=cloud__pb2.GetPveInventoryRequest.SerializeToString,
|
|
75
105
|
response_deserializer=cloud__pb2.GetPveInventoryResponse.FromString,
|
|
76
106
|
_registered_method=True)
|
|
107
|
+
self.GetVmVarsBlake = channel.unary_unary(
|
|
108
|
+
'/protos.CloudService/GetVmVarsBlake',
|
|
109
|
+
request_serializer=cloud__pb2.GetVmVarsBlakeRequest.SerializeToString,
|
|
110
|
+
response_deserializer=cloud__pb2.GetVmVarsBlakeResponse.FromString,
|
|
111
|
+
_registered_method=True)
|
|
77
112
|
|
|
78
113
|
|
|
79
114
|
class CloudServiceServicer(object):
|
|
@@ -91,12 +126,36 @@ class CloudServiceServicer(object):
|
|
|
91
126
|
context.set_details('Method not implemented!')
|
|
92
127
|
raise NotImplementedError('Method not implemented!')
|
|
93
128
|
|
|
129
|
+
def GetCloudFileSecret(self, request, context):
|
|
130
|
+
"""Missing associated documentation comment in .proto file."""
|
|
131
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
132
|
+
context.set_details('Method not implemented!')
|
|
133
|
+
raise NotImplementedError('Method not implemented!')
|
|
134
|
+
|
|
135
|
+
def CreateCloudSecret(self, request, context):
|
|
136
|
+
"""Missing associated documentation comment in .proto file."""
|
|
137
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
138
|
+
context.set_details('Method not implemented!')
|
|
139
|
+
raise NotImplementedError('Method not implemented!')
|
|
140
|
+
|
|
141
|
+
def DeleteCloudSecret(self, request, context):
|
|
142
|
+
"""Missing associated documentation comment in .proto file."""
|
|
143
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
144
|
+
context.set_details('Method not implemented!')
|
|
145
|
+
raise NotImplementedError('Method not implemented!')
|
|
146
|
+
|
|
94
147
|
def GetCloudSecret(self, request, context):
|
|
95
148
|
"""Missing associated documentation comment in .proto file."""
|
|
96
149
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
97
150
|
context.set_details('Method not implemented!')
|
|
98
151
|
raise NotImplementedError('Method not implemented!')
|
|
99
152
|
|
|
153
|
+
def GetCloudSecrets(self, request, context):
|
|
154
|
+
"""Missing associated documentation comment in .proto file."""
|
|
155
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
156
|
+
context.set_details('Method not implemented!')
|
|
157
|
+
raise NotImplementedError('Method not implemented!')
|
|
158
|
+
|
|
100
159
|
def GetCephAccess(self, request, context):
|
|
101
160
|
"""Missing associated documentation comment in .proto file."""
|
|
102
161
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
@@ -115,6 +174,18 @@ class CloudServiceServicer(object):
|
|
|
115
174
|
context.set_details('Method not implemented!')
|
|
116
175
|
raise NotImplementedError('Method not implemented!')
|
|
117
176
|
|
|
177
|
+
def CreateProxmoxApi(self, request, context):
|
|
178
|
+
"""Missing associated documentation comment in .proto file."""
|
|
179
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
180
|
+
context.set_details('Method not implemented!')
|
|
181
|
+
raise NotImplementedError('Method not implemented!')
|
|
182
|
+
|
|
183
|
+
def DeleteProxmoxApi(self, request, context):
|
|
184
|
+
"""Missing associated documentation comment in .proto file."""
|
|
185
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
186
|
+
context.set_details('Method not implemented!')
|
|
187
|
+
raise NotImplementedError('Method not implemented!')
|
|
188
|
+
|
|
118
189
|
def GetProxmoxHost(self, request, context):
|
|
119
190
|
"""Missing associated documentation comment in .proto file."""
|
|
120
191
|
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
@@ -127,6 +198,12 @@ class CloudServiceServicer(object):
|
|
|
127
198
|
context.set_details('Method not implemented!')
|
|
128
199
|
raise NotImplementedError('Method not implemented!')
|
|
129
200
|
|
|
201
|
+
def GetVmVarsBlake(self, request, context):
|
|
202
|
+
"""Missing associated documentation comment in .proto file."""
|
|
203
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
204
|
+
context.set_details('Method not implemented!')
|
|
205
|
+
raise NotImplementedError('Method not implemented!')
|
|
206
|
+
|
|
130
207
|
|
|
131
208
|
def add_CloudServiceServicer_to_server(servicer, server):
|
|
132
209
|
rpc_method_handlers = {
|
|
@@ -140,11 +217,31 @@ def add_CloudServiceServicer_to_server(servicer, server):
|
|
|
140
217
|
request_deserializer=cloud__pb2.GetClusterVarsRequest.FromString,
|
|
141
218
|
response_serializer=cloud__pb2.GetClusterVarsResponse.SerializeToString,
|
|
142
219
|
),
|
|
220
|
+
'GetCloudFileSecret': grpc.unary_unary_rpc_method_handler(
|
|
221
|
+
servicer.GetCloudFileSecret,
|
|
222
|
+
request_deserializer=cloud__pb2.GetCloudFileSecretRequest.FromString,
|
|
223
|
+
response_serializer=cloud__pb2.GetCloudFileSecretResponse.SerializeToString,
|
|
224
|
+
),
|
|
225
|
+
'CreateCloudSecret': grpc.unary_unary_rpc_method_handler(
|
|
226
|
+
servicer.CreateCloudSecret,
|
|
227
|
+
request_deserializer=cloud__pb2.CreateCloudSecretRequest.FromString,
|
|
228
|
+
response_serializer=cloud__pb2.CreateCloudSecretResponse.SerializeToString,
|
|
229
|
+
),
|
|
230
|
+
'DeleteCloudSecret': grpc.unary_unary_rpc_method_handler(
|
|
231
|
+
servicer.DeleteCloudSecret,
|
|
232
|
+
request_deserializer=cloud__pb2.DeleteCloudSecretRequest.FromString,
|
|
233
|
+
response_serializer=cloud__pb2.DeleteCloudSecretResponse.SerializeToString,
|
|
234
|
+
),
|
|
143
235
|
'GetCloudSecret': grpc.unary_unary_rpc_method_handler(
|
|
144
236
|
servicer.GetCloudSecret,
|
|
145
237
|
request_deserializer=cloud__pb2.GetCloudSecretRequest.FromString,
|
|
146
238
|
response_serializer=cloud__pb2.GetCloudSecretResponse.SerializeToString,
|
|
147
239
|
),
|
|
240
|
+
'GetCloudSecrets': grpc.unary_unary_rpc_method_handler(
|
|
241
|
+
servicer.GetCloudSecrets,
|
|
242
|
+
request_deserializer=cloud__pb2.GetCloudSecretsRequest.FromString,
|
|
243
|
+
response_serializer=cloud__pb2.GetCloudSecretsResponse.SerializeToString,
|
|
244
|
+
),
|
|
148
245
|
'GetCephAccess': grpc.unary_unary_rpc_method_handler(
|
|
149
246
|
servicer.GetCephAccess,
|
|
150
247
|
request_deserializer=cloud__pb2.GetCephAccessRequest.FromString,
|
|
@@ -160,6 +257,16 @@ def add_CloudServiceServicer_to_server(servicer, server):
|
|
|
160
257
|
request_deserializer=cloud__pb2.GetProxmoxApiRequest.FromString,
|
|
161
258
|
response_serializer=cloud__pb2.GetProxmoxApiResponse.SerializeToString,
|
|
162
259
|
),
|
|
260
|
+
'CreateProxmoxApi': grpc.unary_unary_rpc_method_handler(
|
|
261
|
+
servicer.CreateProxmoxApi,
|
|
262
|
+
request_deserializer=cloud__pb2.CreateProxmoxApiRequest.FromString,
|
|
263
|
+
response_serializer=cloud__pb2.CreateProxmoxApiResponse.SerializeToString,
|
|
264
|
+
),
|
|
265
|
+
'DeleteProxmoxApi': grpc.unary_unary_rpc_method_handler(
|
|
266
|
+
servicer.DeleteProxmoxApi,
|
|
267
|
+
request_deserializer=cloud__pb2.DeleteProxmoxApiRequest.FromString,
|
|
268
|
+
response_serializer=cloud__pb2.DeleteProxmoxApiResponse.SerializeToString,
|
|
269
|
+
),
|
|
163
270
|
'GetProxmoxHost': grpc.unary_unary_rpc_method_handler(
|
|
164
271
|
servicer.GetProxmoxHost,
|
|
165
272
|
request_deserializer=cloud__pb2.GetProxmoxHostRequest.FromString,
|
|
@@ -170,6 +277,11 @@ def add_CloudServiceServicer_to_server(servicer, server):
|
|
|
170
277
|
request_deserializer=cloud__pb2.GetPveInventoryRequest.FromString,
|
|
171
278
|
response_serializer=cloud__pb2.GetPveInventoryResponse.SerializeToString,
|
|
172
279
|
),
|
|
280
|
+
'GetVmVarsBlake': grpc.unary_unary_rpc_method_handler(
|
|
281
|
+
servicer.GetVmVarsBlake,
|
|
282
|
+
request_deserializer=cloud__pb2.GetVmVarsBlakeRequest.FromString,
|
|
283
|
+
response_serializer=cloud__pb2.GetVmVarsBlakeResponse.SerializeToString,
|
|
284
|
+
),
|
|
173
285
|
}
|
|
174
286
|
generic_handler = grpc.method_handlers_generic_handler(
|
|
175
287
|
'protos.CloudService', rpc_method_handlers)
|
|
@@ -235,6 +347,87 @@ class CloudService(object):
|
|
|
235
347
|
metadata,
|
|
236
348
|
_registered_method=True)
|
|
237
349
|
|
|
350
|
+
@staticmethod
|
|
351
|
+
def GetCloudFileSecret(request,
|
|
352
|
+
target,
|
|
353
|
+
options=(),
|
|
354
|
+
channel_credentials=None,
|
|
355
|
+
call_credentials=None,
|
|
356
|
+
insecure=False,
|
|
357
|
+
compression=None,
|
|
358
|
+
wait_for_ready=None,
|
|
359
|
+
timeout=None,
|
|
360
|
+
metadata=None):
|
|
361
|
+
return grpc.experimental.unary_unary(
|
|
362
|
+
request,
|
|
363
|
+
target,
|
|
364
|
+
'/protos.CloudService/GetCloudFileSecret',
|
|
365
|
+
cloud__pb2.GetCloudFileSecretRequest.SerializeToString,
|
|
366
|
+
cloud__pb2.GetCloudFileSecretResponse.FromString,
|
|
367
|
+
options,
|
|
368
|
+
channel_credentials,
|
|
369
|
+
insecure,
|
|
370
|
+
call_credentials,
|
|
371
|
+
compression,
|
|
372
|
+
wait_for_ready,
|
|
373
|
+
timeout,
|
|
374
|
+
metadata,
|
|
375
|
+
_registered_method=True)
|
|
376
|
+
|
|
377
|
+
@staticmethod
|
|
378
|
+
def CreateCloudSecret(request,
|
|
379
|
+
target,
|
|
380
|
+
options=(),
|
|
381
|
+
channel_credentials=None,
|
|
382
|
+
call_credentials=None,
|
|
383
|
+
insecure=False,
|
|
384
|
+
compression=None,
|
|
385
|
+
wait_for_ready=None,
|
|
386
|
+
timeout=None,
|
|
387
|
+
metadata=None):
|
|
388
|
+
return grpc.experimental.unary_unary(
|
|
389
|
+
request,
|
|
390
|
+
target,
|
|
391
|
+
'/protos.CloudService/CreateCloudSecret',
|
|
392
|
+
cloud__pb2.CreateCloudSecretRequest.SerializeToString,
|
|
393
|
+
cloud__pb2.CreateCloudSecretResponse.FromString,
|
|
394
|
+
options,
|
|
395
|
+
channel_credentials,
|
|
396
|
+
insecure,
|
|
397
|
+
call_credentials,
|
|
398
|
+
compression,
|
|
399
|
+
wait_for_ready,
|
|
400
|
+
timeout,
|
|
401
|
+
metadata,
|
|
402
|
+
_registered_method=True)
|
|
403
|
+
|
|
404
|
+
@staticmethod
|
|
405
|
+
def DeleteCloudSecret(request,
|
|
406
|
+
target,
|
|
407
|
+
options=(),
|
|
408
|
+
channel_credentials=None,
|
|
409
|
+
call_credentials=None,
|
|
410
|
+
insecure=False,
|
|
411
|
+
compression=None,
|
|
412
|
+
wait_for_ready=None,
|
|
413
|
+
timeout=None,
|
|
414
|
+
metadata=None):
|
|
415
|
+
return grpc.experimental.unary_unary(
|
|
416
|
+
request,
|
|
417
|
+
target,
|
|
418
|
+
'/protos.CloudService/DeleteCloudSecret',
|
|
419
|
+
cloud__pb2.DeleteCloudSecretRequest.SerializeToString,
|
|
420
|
+
cloud__pb2.DeleteCloudSecretResponse.FromString,
|
|
421
|
+
options,
|
|
422
|
+
channel_credentials,
|
|
423
|
+
insecure,
|
|
424
|
+
call_credentials,
|
|
425
|
+
compression,
|
|
426
|
+
wait_for_ready,
|
|
427
|
+
timeout,
|
|
428
|
+
metadata,
|
|
429
|
+
_registered_method=True)
|
|
430
|
+
|
|
238
431
|
@staticmethod
|
|
239
432
|
def GetCloudSecret(request,
|
|
240
433
|
target,
|
|
@@ -262,6 +455,33 @@ class CloudService(object):
|
|
|
262
455
|
metadata,
|
|
263
456
|
_registered_method=True)
|
|
264
457
|
|
|
458
|
+
@staticmethod
|
|
459
|
+
def GetCloudSecrets(request,
|
|
460
|
+
target,
|
|
461
|
+
options=(),
|
|
462
|
+
channel_credentials=None,
|
|
463
|
+
call_credentials=None,
|
|
464
|
+
insecure=False,
|
|
465
|
+
compression=None,
|
|
466
|
+
wait_for_ready=None,
|
|
467
|
+
timeout=None,
|
|
468
|
+
metadata=None):
|
|
469
|
+
return grpc.experimental.unary_unary(
|
|
470
|
+
request,
|
|
471
|
+
target,
|
|
472
|
+
'/protos.CloudService/GetCloudSecrets',
|
|
473
|
+
cloud__pb2.GetCloudSecretsRequest.SerializeToString,
|
|
474
|
+
cloud__pb2.GetCloudSecretsResponse.FromString,
|
|
475
|
+
options,
|
|
476
|
+
channel_credentials,
|
|
477
|
+
insecure,
|
|
478
|
+
call_credentials,
|
|
479
|
+
compression,
|
|
480
|
+
wait_for_ready,
|
|
481
|
+
timeout,
|
|
482
|
+
metadata,
|
|
483
|
+
_registered_method=True)
|
|
484
|
+
|
|
265
485
|
@staticmethod
|
|
266
486
|
def GetCephAccess(request,
|
|
267
487
|
target,
|
|
@@ -343,6 +563,60 @@ class CloudService(object):
|
|
|
343
563
|
metadata,
|
|
344
564
|
_registered_method=True)
|
|
345
565
|
|
|
566
|
+
@staticmethod
|
|
567
|
+
def CreateProxmoxApi(request,
|
|
568
|
+
target,
|
|
569
|
+
options=(),
|
|
570
|
+
channel_credentials=None,
|
|
571
|
+
call_credentials=None,
|
|
572
|
+
insecure=False,
|
|
573
|
+
compression=None,
|
|
574
|
+
wait_for_ready=None,
|
|
575
|
+
timeout=None,
|
|
576
|
+
metadata=None):
|
|
577
|
+
return grpc.experimental.unary_unary(
|
|
578
|
+
request,
|
|
579
|
+
target,
|
|
580
|
+
'/protos.CloudService/CreateProxmoxApi',
|
|
581
|
+
cloud__pb2.CreateProxmoxApiRequest.SerializeToString,
|
|
582
|
+
cloud__pb2.CreateProxmoxApiResponse.FromString,
|
|
583
|
+
options,
|
|
584
|
+
channel_credentials,
|
|
585
|
+
insecure,
|
|
586
|
+
call_credentials,
|
|
587
|
+
compression,
|
|
588
|
+
wait_for_ready,
|
|
589
|
+
timeout,
|
|
590
|
+
metadata,
|
|
591
|
+
_registered_method=True)
|
|
592
|
+
|
|
593
|
+
@staticmethod
|
|
594
|
+
def DeleteProxmoxApi(request,
|
|
595
|
+
target,
|
|
596
|
+
options=(),
|
|
597
|
+
channel_credentials=None,
|
|
598
|
+
call_credentials=None,
|
|
599
|
+
insecure=False,
|
|
600
|
+
compression=None,
|
|
601
|
+
wait_for_ready=None,
|
|
602
|
+
timeout=None,
|
|
603
|
+
metadata=None):
|
|
604
|
+
return grpc.experimental.unary_unary(
|
|
605
|
+
request,
|
|
606
|
+
target,
|
|
607
|
+
'/protos.CloudService/DeleteProxmoxApi',
|
|
608
|
+
cloud__pb2.DeleteProxmoxApiRequest.SerializeToString,
|
|
609
|
+
cloud__pb2.DeleteProxmoxApiResponse.FromString,
|
|
610
|
+
options,
|
|
611
|
+
channel_credentials,
|
|
612
|
+
insecure,
|
|
613
|
+
call_credentials,
|
|
614
|
+
compression,
|
|
615
|
+
wait_for_ready,
|
|
616
|
+
timeout,
|
|
617
|
+
metadata,
|
|
618
|
+
_registered_method=True)
|
|
619
|
+
|
|
346
620
|
@staticmethod
|
|
347
621
|
def GetProxmoxHost(request,
|
|
348
622
|
target,
|
|
@@ -396,3 +670,30 @@ class CloudService(object):
|
|
|
396
670
|
timeout,
|
|
397
671
|
metadata,
|
|
398
672
|
_registered_method=True)
|
|
673
|
+
|
|
674
|
+
@staticmethod
|
|
675
|
+
def GetVmVarsBlake(request,
|
|
676
|
+
target,
|
|
677
|
+
options=(),
|
|
678
|
+
channel_credentials=None,
|
|
679
|
+
call_credentials=None,
|
|
680
|
+
insecure=False,
|
|
681
|
+
compression=None,
|
|
682
|
+
wait_for_ready=None,
|
|
683
|
+
timeout=None,
|
|
684
|
+
metadata=None):
|
|
685
|
+
return grpc.experimental.unary_unary(
|
|
686
|
+
request,
|
|
687
|
+
target,
|
|
688
|
+
'/protos.CloudService/GetVmVarsBlake',
|
|
689
|
+
cloud__pb2.GetVmVarsBlakeRequest.SerializeToString,
|
|
690
|
+
cloud__pb2.GetVmVarsBlakeResponse.FromString,
|
|
691
|
+
options,
|
|
692
|
+
channel_credentials,
|
|
693
|
+
insecure,
|
|
694
|
+
call_credentials,
|
|
695
|
+
compression,
|
|
696
|
+
wait_for_ready,
|
|
697
|
+
timeout,
|
|
698
|
+
metadata,
|
|
699
|
+
_registered_method=True)
|
pve_cloud_rpc/server.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import asyncio
|
|
2
2
|
import socket
|
|
3
3
|
import sys
|
|
4
|
+
import json
|
|
4
5
|
|
|
5
6
|
import asyncssh
|
|
6
7
|
import grpc
|
|
@@ -12,6 +13,10 @@ import pve_cloud_rpc.protos.cloud_pb2 as cloud_pb2
|
|
|
12
13
|
import pve_cloud_rpc.protos.cloud_pb2_grpc as cloud_pb2_grpc
|
|
13
14
|
import pve_cloud_rpc.protos.health_pb2 as health_pb2
|
|
14
15
|
import pve_cloud_rpc.protos.health_pb2_grpc as health_pb2_grpc
|
|
16
|
+
from pve_cloud.orm.alchemy import ProxmoxCloudSecrets, VirtualMachineVars
|
|
17
|
+
from sqlalchemy import create_engine, select, delete
|
|
18
|
+
from sqlalchemy.orm import Session
|
|
19
|
+
from sqlalchemy.exc import IntegrityError
|
|
15
20
|
|
|
16
21
|
|
|
17
22
|
class HealthServicer(health_pb2_grpc.HealthServicer):
|
|
@@ -34,6 +39,30 @@ class HealthServicer(health_pb2_grpc.HealthServicer):
|
|
|
34
39
|
) # go provider process will kill
|
|
35
40
|
|
|
36
41
|
|
|
42
|
+
async def get_engine(online_pve_host):
|
|
43
|
+
async with asyncssh.connect(
|
|
44
|
+
online_pve_host, username="root", known_hosts=None
|
|
45
|
+
) as conn:
|
|
46
|
+
cmd = await conn.run(
|
|
47
|
+
"cat /etc/pve/cloud/secrets/patroni.pass", check=True
|
|
48
|
+
)
|
|
49
|
+
patroni_pass = cmd.stdout.rstrip()
|
|
50
|
+
|
|
51
|
+
# fetch cluster vars to get internal proxy ip
|
|
52
|
+
cmd = await conn.run(
|
|
53
|
+
"cat /etc/pve/cloud/cluster_vars.yaml", check=True
|
|
54
|
+
)
|
|
55
|
+
cluster_vars = yaml.safe_load(cmd.stdout)
|
|
56
|
+
|
|
57
|
+
# build the connection string
|
|
58
|
+
patroni_cstr = f"postgresql+psycopg2://postgres:{patroni_pass}@{cluster_vars['pve_haproxy_floating_ip_internal']}:5000/pve_cloud?sslmode=disable"
|
|
59
|
+
|
|
60
|
+
# insert the secret
|
|
61
|
+
engine = create_engine(patroni_cstr)
|
|
62
|
+
|
|
63
|
+
return engine
|
|
64
|
+
|
|
65
|
+
|
|
37
66
|
class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
|
|
38
67
|
|
|
39
68
|
async def GetMasterKubeconfig(self, request, context):
|
|
@@ -55,7 +84,9 @@ class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
|
|
|
55
84
|
|
|
56
85
|
return cloud_pb2.GetClusterVarsResponse(vars=yaml.safe_dump(cluster_vars))
|
|
57
86
|
|
|
58
|
-
|
|
87
|
+
# file secrets are default secrets created by the collections playbook stored on the proxmox hosts
|
|
88
|
+
# under /etc/pve/cloud/secrets
|
|
89
|
+
async def GetCloudFileSecret(self, request, context):
|
|
59
90
|
target_pve = request.target_pve
|
|
60
91
|
secret_name = request.secret_name
|
|
61
92
|
|
|
@@ -73,7 +104,96 @@ class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
|
|
|
73
104
|
): # defaults to true but in special cases user might want to keep newlines (e.g. certs)
|
|
74
105
|
catted_secret = catted_secret.rstrip()
|
|
75
106
|
|
|
76
|
-
return cloud_pb2.
|
|
107
|
+
return cloud_pb2.GetCloudFileSecretResponse(secret=catted_secret)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
# non file proxmox cloud secrets are stored in the patroni database
|
|
111
|
+
async def CreateCloudSecret(self, request, context):
|
|
112
|
+
target_pve = request.target_pve
|
|
113
|
+
secret_name = request.secret_name
|
|
114
|
+
secret_data = json.loads(request.secret_data)
|
|
115
|
+
secret_type = request.secret_type
|
|
116
|
+
|
|
117
|
+
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
118
|
+
engine = await get_engine(online_pve_host)
|
|
119
|
+
|
|
120
|
+
with Session(engine) as session:
|
|
121
|
+
try:
|
|
122
|
+
session.add(ProxmoxCloudSecrets(
|
|
123
|
+
target_pve=target_pve,
|
|
124
|
+
secret_name=secret_name,
|
|
125
|
+
secret_data=secret_data,
|
|
126
|
+
secret_type=secret_type
|
|
127
|
+
))
|
|
128
|
+
session.commit()
|
|
129
|
+
|
|
130
|
+
except IntegrityError as e:
|
|
131
|
+
session.rollback()
|
|
132
|
+
return cloud_pb2.CreateCloudSecretResponse(success=False, err_message=str(e))
|
|
133
|
+
|
|
134
|
+
return cloud_pb2.CreateCloudSecretResponse(success=True)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
async def DeleteCloudSecret(self, request, context):
|
|
138
|
+
target_pve = request.target_pve
|
|
139
|
+
secret_name = request.secret_name
|
|
140
|
+
|
|
141
|
+
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
142
|
+
engine = await get_engine(online_pve_host)
|
|
143
|
+
|
|
144
|
+
with Session(engine) as session:
|
|
145
|
+
stmt = delete(ProxmoxCloudSecrets).where(
|
|
146
|
+
ProxmoxCloudSecrets.target_pve == target_pve,
|
|
147
|
+
ProxmoxCloudSecrets.secret_name == secret_name
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
result = session.execute(stmt)
|
|
151
|
+
session.commit()
|
|
152
|
+
|
|
153
|
+
return cloud_pb2.DeleteCloudSecretResponse(success=True)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
async def GetCloudSecret(self, request, context):
|
|
157
|
+
target_pve = request.target_pve
|
|
158
|
+
secret_name = request.secret_name
|
|
159
|
+
|
|
160
|
+
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
161
|
+
engine = await get_engine(online_pve_host)
|
|
162
|
+
|
|
163
|
+
with Session(engine) as session:
|
|
164
|
+
stmt = select(ProxmoxCloudSecrets).where(ProxmoxCloudSecrets.target_pve == target_pve and ProxmoxCloudSecrets.secret_name == secret_name)
|
|
165
|
+
record = session.scalars(stmt).first()
|
|
166
|
+
|
|
167
|
+
return cloud_pb2.GetCloudSecretResponse(secret=json.dumps(record.secret_data))
|
|
168
|
+
|
|
169
|
+
# fetch by type
|
|
170
|
+
async def GetCloudSecrets(self, request, context):
|
|
171
|
+
target_pve = request.target_pve
|
|
172
|
+
secret_type = request.secret_type
|
|
173
|
+
|
|
174
|
+
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
175
|
+
engine = await get_engine(online_pve_host)
|
|
176
|
+
|
|
177
|
+
with Session(engine) as session:
|
|
178
|
+
stmt = select(ProxmoxCloudSecrets).where(ProxmoxCloudSecrets.target_pve == target_pve and ProxmoxCloudSecrets.secret_type == secret_type)
|
|
179
|
+
records = session.scalars(stmt).all()
|
|
180
|
+
|
|
181
|
+
return cloud_pb2.GetCloudSecretsResponse(secrets=json.dumps({record.secret_name: record.secret_data for record in records}))
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
async def GetVmVarsBlake(self, request, context):
|
|
185
|
+
blake_ids = request.blake_ids
|
|
186
|
+
target_pve = request.target_pve
|
|
187
|
+
|
|
188
|
+
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
189
|
+
engine = await get_engine(online_pve_host)
|
|
190
|
+
|
|
191
|
+
with Session(engine) as session:
|
|
192
|
+
stmt = select(VirtualMachineVars).where(VirtualMachineVars.blake_id.in_(blake_ids))
|
|
193
|
+
records = session.scalars(stmt).all()
|
|
194
|
+
|
|
195
|
+
return cloud_pb2.GetVmVarsBlakeResponse(blake_id_vars={entry.blake_id: json.dumps(entry.vm_vars) for entry in records})
|
|
196
|
+
|
|
77
197
|
|
|
78
198
|
async def GetCephAccess(self, request, context):
|
|
79
199
|
target_pve = request.target_pve
|
|
@@ -122,7 +242,7 @@ class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
|
|
|
122
242
|
) as conn:
|
|
123
243
|
args_string = None
|
|
124
244
|
if request.get_args:
|
|
125
|
-
args_string = " ".join(f"{k} {v}" for k, v in request.get_args.items())
|
|
245
|
+
args_string = " ".join(f"{k} '{v}'" for k, v in request.get_args.items())
|
|
126
246
|
|
|
127
247
|
cmd = await conn.run(
|
|
128
248
|
f"pvesh get {request.api_path} {args_string} --output-format json",
|
|
@@ -132,6 +252,46 @@ class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
|
|
|
132
252
|
|
|
133
253
|
return cloud_pb2.GetProxmoxApiResponse(json_resp=resp_json)
|
|
134
254
|
|
|
255
|
+
async def CreateProxmoxApi(self, request, context):
|
|
256
|
+
target_pve = request.target_pve
|
|
257
|
+
|
|
258
|
+
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
259
|
+
async with asyncssh.connect(
|
|
260
|
+
online_pve_host, username="root", known_hosts=None
|
|
261
|
+
) as conn:
|
|
262
|
+
args_string = None
|
|
263
|
+
if request.create_args:
|
|
264
|
+
args_string = " ".join(f"{k} '{v}'" for k, v in request.create_args.items())
|
|
265
|
+
try:
|
|
266
|
+
print(f"pvesh create {request.api_path} {args_string}")
|
|
267
|
+
cmd = await conn.run(
|
|
268
|
+
f"pvesh create {request.api_path} {args_string}",
|
|
269
|
+
check=True,
|
|
270
|
+
)
|
|
271
|
+
print(cmd.stdout)
|
|
272
|
+
except asyncssh.ProcessError as e:
|
|
273
|
+
return cloud_pb2.CreateProxmoxApiResponse(success=False, err_message=f"Exit code {e.exit_status} - {e.stderr}")
|
|
274
|
+
|
|
275
|
+
return cloud_pb2.CreateProxmoxApiResponse(success=True)
|
|
276
|
+
|
|
277
|
+
async def DeleteProxmoxApi(self, request, context):
|
|
278
|
+
target_pve = request.target_pve
|
|
279
|
+
|
|
280
|
+
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
281
|
+
async with asyncssh.connect(
|
|
282
|
+
online_pve_host, username="root", known_hosts=None
|
|
283
|
+
) as conn:
|
|
284
|
+
try:
|
|
285
|
+
cmd = await conn.run(
|
|
286
|
+
f"pvesh delete {request.api_path}",
|
|
287
|
+
check=True,
|
|
288
|
+
)
|
|
289
|
+
print(cmd.stdout)
|
|
290
|
+
except asyncssh.ProcessError as e:
|
|
291
|
+
return cloud_pb2.DeleteProxmoxApiResponse(success=False, err_message=f"Exit code {e.exit_status} - {e.stderr}")
|
|
292
|
+
|
|
293
|
+
return cloud_pb2.DeleteProxmoxApiResponse(success=True)
|
|
294
|
+
|
|
135
295
|
async def GetProxmoxHost(self, request, context):
|
|
136
296
|
target_pve = request.target_pve
|
|
137
297
|
online_pve_host = get_online_pve_host(target_pve, skip_py_cloud_check=True)
|
|
@@ -148,7 +308,6 @@ class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
|
|
|
148
308
|
inventory=yaml.safe_dump(pve_inventory), cloud_domain=cloud_domain
|
|
149
309
|
)
|
|
150
310
|
|
|
151
|
-
|
|
152
311
|
def is_port_bound(port, host="0.0.0.0"):
|
|
153
312
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
154
313
|
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rpyc-pve-cloud
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0rc0
|
|
4
4
|
Author-email: Tobias Huebner <tobias.huebner@vmzberlin.com>
|
|
5
5
|
License-Expression: GPL-3.0-or-later
|
|
6
6
|
License-File: LICENSE.md
|
|
7
|
-
Requires-Dist: py-pve-cloud==0.
|
|
7
|
+
Requires-Dist: py-pve-cloud==0.15.0rc0
|
|
8
8
|
Requires-Dist: grpcio==1.76.0
|
|
9
9
|
Requires-Dist: asyncssh==2.22.0
|
|
10
10
|
Requires-Dist: protobuf==6.33.4
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
pve_cloud_rpc/_version.py,sha256=W0Nz2M74b-kThgrTvkhrB8zIno6lQEZG0KXlqDMEO3k,26
|
|
2
|
+
pve_cloud_rpc/server.py,sha256=5aqTe7nyoBS5TIIFh2HAm1I3s8p7Zjr4VH7xBZrcaSQ,13183
|
|
3
|
+
pve_cloud_rpc/protos/cloud_pb2.py,sha256=2FFa9SSpkdSD1ie_NiAGFGjz92yx028DhEALJazCIdE,11237
|
|
4
|
+
pve_cloud_rpc/protos/cloud_pb2_grpc.py,sha256=V-q4n-dI0nstsuHZLbNyaxk4-3jU8aTWqbeFR8p5SDk,27826
|
|
5
|
+
pve_cloud_rpc/protos/health_pb2.py,sha256=532OgHM0bPu6uyJNyYETlRJp9BzcCZ53fnrRtEu7bnA,2188
|
|
6
|
+
pve_cloud_rpc/protos/health_pb2_grpc.py,sha256=XXT8lsH8YgKLqn07YfigSQ6TNW6s-P4V6S-X69fLfh0,3368
|
|
7
|
+
rpyc_pve_cloud-0.2.0rc0.dist-info/licenses/LICENSE.md,sha256=ADUqsZhl4juwq34PRTMiBqumpm11s_PMli_dZQjWPqQ,34260
|
|
8
|
+
rpyc_pve_cloud-0.2.0rc0.dist-info/METADATA,sha256=GR-y-u1pxB_Gdekwwy9mnW1ZpVU8l5_bExDtbU_is4I,338
|
|
9
|
+
rpyc_pve_cloud-0.2.0rc0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
10
|
+
rpyc_pve_cloud-0.2.0rc0.dist-info/entry_points.txt,sha256=h4ytTryc_8IlySP_ICyy6srHzF71qrQ0noUhqI-3aGw,52
|
|
11
|
+
rpyc_pve_cloud-0.2.0rc0.dist-info/top_level.txt,sha256=CTGM4RRp33khtroUiv-RiYXI4h6W6AaQQGIvsbwAetM,14
|
|
12
|
+
rpyc_pve_cloud-0.2.0rc0.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
pve_cloud_rpc/_version.py,sha256=ZWlYP69jUhCUfAHm0FzrEXyOuR2EecZTBnPhCLeW5RA,26
|
|
2
|
-
pve_cloud_rpc/server.py,sha256=H93TE9-SZEftrQZdoMXmbke_8xTDH3MGXxOt4eSNLBQ,6763
|
|
3
|
-
pve_cloud_rpc/protos/cloud_pb2.py,sha256=j5xbJDc0nGhM73Z27UxpTWoWksgR8OTwE77R3JhlfkY,6171
|
|
4
|
-
pve_cloud_rpc/protos/cloud_pb2_grpc.py,sha256=FOC_MXEZkXe32dzxQua9zHBLWLjso1X-xqj0xTexfFg,15535
|
|
5
|
-
pve_cloud_rpc/protos/health_pb2.py,sha256=532OgHM0bPu6uyJNyYETlRJp9BzcCZ53fnrRtEu7bnA,2188
|
|
6
|
-
pve_cloud_rpc/protos/health_pb2_grpc.py,sha256=XXT8lsH8YgKLqn07YfigSQ6TNW6s-P4V6S-X69fLfh0,3368
|
|
7
|
-
rpyc_pve_cloud-0.1.7rc0.dist-info/licenses/LICENSE.md,sha256=ADUqsZhl4juwq34PRTMiBqumpm11s_PMli_dZQjWPqQ,34260
|
|
8
|
-
rpyc_pve_cloud-0.1.7rc0.dist-info/METADATA,sha256=t9yJCDbAE2uLe3uKUOxMmS8fwdXnNGGhB0Ewc89sews,338
|
|
9
|
-
rpyc_pve_cloud-0.1.7rc0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
rpyc_pve_cloud-0.1.7rc0.dist-info/entry_points.txt,sha256=h4ytTryc_8IlySP_ICyy6srHzF71qrQ0noUhqI-3aGw,52
|
|
11
|
-
rpyc_pve_cloud-0.1.7rc0.dist-info/top_level.txt,sha256=CTGM4RRp33khtroUiv-RiYXI4h6W6AaQQGIvsbwAetM,14
|
|
12
|
-
rpyc_pve_cloud-0.1.7rc0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|