rpyc-pve-cloud 0.0.30__tar.gz → 0.0.32__tar.gz

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.
Files changed (20) hide show
  1. {rpyc_pve_cloud-0.0.30/src/rpyc_pve_cloud.egg-info → rpyc_pve_cloud-0.0.32}/PKG-INFO +2 -2
  2. rpyc_pve_cloud-0.0.32/README.md +46 -0
  3. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/requirements.txt +1 -1
  4. rpyc_pve_cloud-0.0.32/src/pve_cloud_rpc/_version.py +1 -0
  5. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/pve_cloud_rpc/protos/cloud_pb2.py +0 -3
  6. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/pve_cloud_rpc/protos/cloud_pb2_grpc.py +0 -3
  7. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/pve_cloud_rpc/protos/health_pb2.py +8 -11
  8. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/pve_cloud_rpc/protos/health_pb2_grpc.py +0 -3
  9. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/pve_cloud_rpc/server.py +8 -22
  10. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32/src/rpyc_pve_cloud.egg-info}/PKG-INFO +2 -2
  11. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/rpyc_pve_cloud.egg-info/requires.txt +1 -1
  12. rpyc_pve_cloud-0.0.30/README.md +0 -104
  13. rpyc_pve_cloud-0.0.30/src/pve_cloud_rpc/_version.py +0 -1
  14. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/LICENSE.md +0 -0
  15. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/pyproject.toml +0 -0
  16. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/setup.cfg +0 -0
  17. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/rpyc_pve_cloud.egg-info/SOURCES.txt +0 -0
  18. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/rpyc_pve_cloud.egg-info/dependency_links.txt +0 -0
  19. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/rpyc_pve_cloud.egg-info/entry_points.txt +0 -0
  20. {rpyc_pve_cloud-0.0.30 → rpyc_pve_cloud-0.0.32}/src/rpyc_pve_cloud.egg-info/top_level.txt +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rpyc-pve-cloud
3
- Version: 0.0.30
3
+ Version: 0.0.32
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.14.0,>=0.13.11
7
+ Requires-Dist: py-pve-cloud<0.14.0,>=0.13.13
8
8
  Requires-Dist: grpcio==1.76.0
9
9
  Requires-Dist: asyncssh==2.21.0
10
10
  Requires-Dist: protobuf==6.33.2
@@ -0,0 +1,46 @@
1
+ # Terraform Proxmox Cloud Provider
2
+
3
+ This repository contains the terraform provider connecting to proxmox cloud instances.
4
+
5
+ ## Building documentation
6
+
7
+ `go install` and `make generate`
8
+
9
+ ## Building Proto files
10
+
11
+ ```bash
12
+ # python proto files
13
+ pip install grpcio-tools-1.76.0
14
+
15
+ python -m grpc_tools.protoc -I./protos --python_out=./src/pve_cloud_rpc/protos --grpc_python_out=./src/pve_cloud_rpc/protos ./protos/*.proto
16
+ sed -i 's|import cloud_pb2|import pve_cloud_rpc.protos.cloud_pb2|g' src/pve_cloud_rpc/protos/cloud_pb2_grpc.py
17
+ sed -i 's|import health_pb2|import pve_cloud_rpc.protos.health_pb2|g' src/pve_cloud_rpc/protos/health_pb2_grpc.py
18
+
19
+ # golang proto files
20
+ # need protocompiler 3 (installed via apt)
21
+ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
22
+ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
23
+ export PATH="$PATH:$(go env GOPATH)/bin"
24
+ protoc --go_out=./internal/provider --go_opt=paths=source_relative \
25
+ --go-grpc_out=./internal/provider --go-grpc_opt=paths=source_relative \
26
+ ./protos/*.proto
27
+
28
+ ```
29
+
30
+ ## TDD Dev
31
+
32
+ Supports proxmox cloud tddog development.
33
+
34
+ ## Adding Dependencies
35
+
36
+ This provider uses [Go modules](https://github.com/golang/go/wiki/Modules).
37
+ Please see the Go documentation for the most up to date information about using Go modules.
38
+
39
+ To add a new dependency `github.com/author/dependency` to your Terraform provider:
40
+
41
+ ```shell
42
+ go get github.com/author/dependency
43
+ go mod tidy
44
+ ```
45
+
46
+ Then commit the changes to `go.mod` and `go.sum`.
@@ -1,5 +1,5 @@
1
1
  # pessimistic operator for local tdd installs (pip install -e .)
2
- py-pve-cloud>=0.13.11,<0.14.0
2
+ py-pve-cloud>=0.13.13,<0.14.0
3
3
  grpcio==1.76.0
4
4
  asyncssh==2.21.0
5
5
  protobuf==6.33.2
@@ -0,0 +1 @@
1
+ __version__ = "0.0.32"
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # -*- coding: utf-8 -*-
5
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
6
3
  # NO CHECKED-IN PROTOBUF GENCODE
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
5
2
  """Client and server classes corresponding to protobuf-defined services."""
6
3
  import grpc
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # -*- coding: utf-8 -*-
5
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
6
3
  # NO CHECKED-IN PROTOBUF GENCODE
@@ -27,7 +24,7 @@ _sym_db = _symbol_database.Default()
27
24
 
28
25
 
29
26
 
30
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0chealth.proto\x12\x06protos\"%\n\x12HealthCheckRequest\x12\x0f\n\x07service\x18\x01 \x01(\t\"\xa1\x01\n\x13HealthCheckResponse\x12\x39\n\x06status\x18\x01 \x01(\x0e\x32).protos.HealthCheckResponse.ServingStatus\"O\n\rServingStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x0b\n\x07SERVING\x10\x01\x12\x0f\n\x0bNOT_SERVING\x10\x02\x12\x13\n\x0fSERVICE_UNKNOWN\x10\x03\x32J\n\x06Health\x12@\n\x05\x43heck\x12\x1a.protos.HealthCheckRequest\x1a\x1b.protos.HealthCheckResponseBQZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protosb\x06proto3')
27
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0chealth.proto\x12\x06protos\"(\n\x12HealthCheckRequest\x12\x12\n\ntarget_pve\x18\x01 \x01(\t\"\x94\x01\n\x13HealthCheckResponse\x12\x39\n\x06status\x18\x01 \x01(\x0e\x32).protos.HealthCheckResponse.ServingStatus\x12\x15\n\rerror_message\x18\x02 \x01(\t\"+\n\rServingStatus\x12\x0b\n\x07SERVING\x10\x00\x12\r\n\tMISSMATCH\x10\x01\x32J\n\x06Health\x12@\n\x05\x43heck\x12\x1a.protos.HealthCheckRequest\x1a\x1b.protos.HealthCheckResponseBQZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protosb\x06proto3')
31
28
 
32
29
  _globals = globals()
33
30
  _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
@@ -36,11 +33,11 @@ if not _descriptor._USE_C_DESCRIPTORS:
36
33
  _globals['DESCRIPTOR']._loaded_options = None
37
34
  _globals['DESCRIPTOR']._serialized_options = b'ZOgithub.com/Proxmox-Cloud/terraform-provider-pxc/internal/provider/protos;protos'
38
35
  _globals['_HEALTHCHECKREQUEST']._serialized_start=24
39
- _globals['_HEALTHCHECKREQUEST']._serialized_end=61
40
- _globals['_HEALTHCHECKRESPONSE']._serialized_start=64
41
- _globals['_HEALTHCHECKRESPONSE']._serialized_end=225
42
- _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_start=146
43
- _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_end=225
44
- _globals['_HEALTH']._serialized_start=227
45
- _globals['_HEALTH']._serialized_end=301
36
+ _globals['_HEALTHCHECKREQUEST']._serialized_end=64
37
+ _globals['_HEALTHCHECKRESPONSE']._serialized_start=67
38
+ _globals['_HEALTHCHECKRESPONSE']._serialized_end=215
39
+ _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_start=172
40
+ _globals['_HEALTHCHECKRESPONSE_SERVINGSTATUS']._serialized_end=215
41
+ _globals['_HEALTH']._serialized_start=217
42
+ _globals['_HEALTH']._serialized_end=291
46
43
  # @@protoc_insertion_point(module_scope)
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
5
2
  """Client and server classes corresponding to protobuf-defined services."""
6
3
  import grpc
@@ -1,6 +1,3 @@
1
- # Copyright (c) HashiCorp, Inc.
2
- # SPDX-License-Identifier: MPL-2.0
3
-
4
1
  import asyncio, asyncssh
5
2
  import grpc
6
3
  import pve_cloud_rpc.protos.cloud_pb2 as cloud_pb2
@@ -15,17 +12,16 @@ import sys
15
12
 
16
13
 
17
14
  class HealthServicer(health_pb2_grpc.HealthServicer):
18
- def __init__(self):
19
- self._statuses = {}
20
15
 
16
+ # this also performs the py-pve-cloud version check to not run against incompatible
17
+ # installed proxmox cloud versions
21
18
  async def Check(self, request, context):
22
- service_name = request.service or ""
23
- status = self._statuses.get(service_name, health_pb2.HealthCheckResponse.UNKNOWN)
24
- print(f"Health Check request for service '{service_name}', returning {status}")
25
- return health_pb2.HealthCheckResponse(status=status)
26
-
27
- def set_status(self, service_name: str, status: health_pb2.HealthCheckResponse.ServingStatus):
28
- self._statuses[service_name] = status
19
+ target_pve = request.target_pve
20
+ try:
21
+ get_online_pve_host(target_pve, skip_py_cloud_check=False) # actually perform the check
22
+ return health_pb2.HealthCheckResponse(status=health_pb2.HealthCheckResponse.SERVING)
23
+ except RuntimeError as e:
24
+ return health_pb2.HealthCheckResponse(status=health_pb2.HealthCheckResponse.MISSMATCH, error_message=f"py-pve-cloud version check failed with: {e}") # go provider process will kill
29
25
 
30
26
 
31
27
  class CloudServiceServicer(cloud_pb2_grpc.CloudServiceServicer):
@@ -139,21 +135,12 @@ async def serve():
139
135
 
140
136
  health_servicer = HealthServicer()
141
137
  health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
142
-
143
- # if is_port_bound(50052): # google quirks nice
144
- # raise RuntimeError("PCRPC Already running / unclean shutdown!")
145
138
 
146
139
  socket_file = f"/tmp/pc-rpc-{sys.argv[1]}.sock"
147
140
 
148
- # listen_addr = "[::]:50052"
149
141
  server.add_insecure_port(f"unix://{socket_file}")
150
142
  await server.start()
151
143
 
152
- health_servicer.set_status(
153
- "", # empty = overall server health
154
- health_pb2.HealthCheckResponse.SERVING
155
- )
156
- # print(f"gRPC AsyncIO server running on {listen_addr}")
157
144
  print(f"gRPC AsyncIO server running on {socket_file}")
158
145
  try:
159
146
  await server.wait_for_termination()
@@ -167,6 +154,5 @@ async def serve():
167
154
  os.remove(socket_file)
168
155
 
169
156
 
170
-
171
157
  def main():
172
158
  asyncio.run(serve())
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rpyc-pve-cloud
3
- Version: 0.0.30
3
+ Version: 0.0.32
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.14.0,>=0.13.11
7
+ Requires-Dist: py-pve-cloud<0.14.0,>=0.13.13
8
8
  Requires-Dist: grpcio==1.76.0
9
9
  Requires-Dist: asyncssh==2.21.0
10
10
  Requires-Dist: protobuf==6.33.2
@@ -1,4 +1,4 @@
1
- py-pve-cloud<0.14.0,>=0.13.11
1
+ py-pve-cloud<0.14.0,>=0.13.13
2
2
  grpcio==1.76.0
3
3
  asyncssh==2.21.0
4
4
  protobuf==6.33.2
@@ -1,104 +0,0 @@
1
- # Terraform Proxmox Cloud Provider
2
-
3
- This repository contains the terraform provider connecting to proxmox cloud instances.
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
- Terraform Provider Scaffolding (Terraform Plugin Framework)
12
-
13
- _This template repository is built on the [Terraform Plugin Framework](https://github.com/hashicorp/terraform-plugin-framework). The template repository built on the [Terraform Plugin SDK](https://github.com/hashicorp/terraform-plugin-sdk) can be found at [terraform-provider-scaffolding](https://github.com/hashicorp/terraform-provider-scaffolding). See [Which SDK Should I Use?](https://developer.hashicorp.com/terraform/plugin/framework-benefits) in the Terraform documentation for additional information._
14
-
15
- This repository is a *template* for a [Terraform](https://www.terraform.io) provider. It is intended as a starting point for creating Terraform providers, containing:
16
-
17
- - A resource and a data source (`internal/provider/`),
18
- - Examples (`examples/`) and generated documentation (`docs/`),
19
- - Miscellaneous meta files.
20
-
21
- These files contain boilerplate code that you will need to edit to create your own Terraform provider. Tutorials for creating Terraform providers can be found on the [HashiCorp Developer](https://developer.hashicorp.com/terraform/tutorials/providers-plugin-framework) platform. _Terraform Plugin Framework specific guides are titled accordingly._
22
-
23
- Please see the [GitHub template repository documentation](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-from-a-template) for how to create a new repository from this template on GitHub.
24
-
25
- Once you've written your provider, you'll want to [publish it on the Terraform Registry](https://developer.hashicorp.com/terraform/registry/providers/publishing) so that others can use it.
26
-
27
- ## Requirements
28
-
29
- - [Terraform](https://developer.hashicorp.com/terraform/downloads) >= 1.0
30
- - [Go](https://golang.org/doc/install) >= 1.24
31
-
32
- ## Building The Provider
33
-
34
- 1. Clone the repository
35
- 1. Enter the repository directory
36
- 1. Build the provider using the Go `install` command:
37
-
38
- ```shell
39
- go install
40
- ```
41
-
42
-
43
- ## Adding Dependencies
44
-
45
- This provider uses [Go modules](https://github.com/golang/go/wiki/Modules).
46
- Please see the Go documentation for the most up to date information about using Go modules.
47
-
48
- To add a new dependency `github.com/author/dependency` to your Terraform provider:
49
-
50
- ```shell
51
- go get github.com/author/dependency
52
- go mod tidy
53
- ```
54
-
55
- Then commit the changes to `go.mod` and `go.sum`.
56
-
57
- ## Using the provider
58
-
59
- Fill this in for each provider
60
-
61
- ## Developing the Provider
62
-
63
- If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (see [Requirements](#requirements) above).
64
-
65
- To compile the provider, run `go install`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
66
-
67
- To generate or update documentation, run `make generate`.
68
-
69
- In order to run the full suite of Acceptance tests, run `make testacc`.
70
-
71
- *Note:* Acceptance tests create real resources, and often cost money to run.
72
-
73
- ```shell
74
- make testacc
75
- ```
76
-
77
-
78
- ## TDD Dev
79
-
80
-
81
- ```bash
82
-
83
-
84
- pip install grpcio-tools-1.76.0
85
-
86
-
87
- install protocompiler 3 (apt)
88
- go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
89
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
90
-
91
-
92
- python -m grpc_tools.protoc -I./protos --python_out=./src/pve_cloud_rpc/protos --grpc_python_out=./src/pve_cloud_rpc/protos ./protos/*.proto
93
- sed -i 's|import cloud_pb2|import pve_cloud_rpc.protos.cloud_pb2|g' src/pve_cloud_rpc/protos/cloud_pb2_grpc.py
94
- sed -i 's|import health_pb2|import pve_cloud_rpc.protos.health_pb2|g' src/pve_cloud_rpc/protos/health_pb2_grpc.py
95
-
96
- export PATH="$PATH:$(go env GOPATH)/bin"
97
- protoc --go_out=./internal/provider --go_opt=paths=source_relative \
98
- --go-grpc_out=./internal/provider --go-grpc_opt=paths=source_relative \
99
- ./protos/*.proto
100
-
101
-
102
-
103
-
104
- ```
@@ -1 +0,0 @@
1
- __version__ = "0.0.30"