From 5ae5a31f06d8cc8c212fe916ab638b30c9413bb0 Mon Sep 17 00:00:00 2001 From: Daniel Muehlbachler-Pietrzykowski Date: Sun, 16 Jan 2022 10:31:07 +0100 Subject: [PATCH] feat: add PluginDownloadUrl for GitHub releases --- .../cmd/pulumi-resource-proxmoxve/schema.json | 2 + provider/go.mod | 4 +- provider/go.sum | 31 +++--- provider/resources.go | 1 + sdk/dotnet/Pulumi.ProxmoxVE.csproj | 5 + sdk/dotnet/pulumi-plugin.json | 5 + sdk/dotnet/version.txt | 2 +- sdk/go/proxmoxve/certifi.go | 1 + sdk/go/proxmoxve/cluster/clusterAlias.go | 1 + sdk/go/proxmoxve/cluster/clusterIPSet.go | 1 + sdk/go/proxmoxve/cluster/getClusterAlias.go | 1 + sdk/go/proxmoxve/cluster/getClusterAliases.go | 1 + sdk/go/proxmoxve/cluster/getNodes.go | 1 + sdk/go/proxmoxve/cluster/pulumiUtilities.go | 99 +++++++++++++++++++ sdk/go/proxmoxve/ct/container.go | 1 + sdk/go/proxmoxve/ct/pulumiUtilities.go | 99 +++++++++++++++++++ sdk/go/proxmoxve/dns.go | 1 + sdk/go/proxmoxve/getDNS.go | 1 + sdk/go/proxmoxve/getHosts.go | 1 + sdk/go/proxmoxve/getTime.go | 1 + sdk/go/proxmoxve/getVersion.go | 1 + sdk/go/proxmoxve/hosts.go | 1 + sdk/go/proxmoxve/permission/getGroup.go | 1 + sdk/go/proxmoxve/permission/getGroups.go | 1 + sdk/go/proxmoxve/permission/getPool.go | 1 + sdk/go/proxmoxve/permission/getPools.go | 1 + sdk/go/proxmoxve/permission/getRole.go | 1 + sdk/go/proxmoxve/permission/getRoles.go | 1 + sdk/go/proxmoxve/permission/getUser.go | 1 + sdk/go/proxmoxve/permission/getUsers.go | 1 + sdk/go/proxmoxve/permission/group.go | 1 + sdk/go/proxmoxve/permission/pool.go | 1 + .../proxmoxve/permission/pulumiUtilities.go | 99 +++++++++++++++++++ sdk/go/proxmoxve/permission/role.go | 1 + sdk/go/proxmoxve/permission/user.go | 1 + sdk/go/proxmoxve/provider.go | 1 + sdk/go/proxmoxve/pulumi-plugin.json | 5 + sdk/go/proxmoxve/pulumiUtilities.go | 14 +++ sdk/go/proxmoxve/storage/file.go | 1 + sdk/go/proxmoxve/storage/getDatastores.go | 1 + sdk/go/proxmoxve/storage/pulumiUtilities.go | 99 +++++++++++++++++++ sdk/go/proxmoxve/time.go | 1 + sdk/go/proxmoxve/vm/pulumiUtilities.go | 99 +++++++++++++++++++ sdk/go/proxmoxve/vm/virtualMachine.go | 1 + sdk/nodejs/certifi.ts | 4 +- sdk/nodejs/cluster/clusterAlias.ts | 4 +- sdk/nodejs/cluster/clusterIPSet.ts | 4 +- sdk/nodejs/cluster/getClusterAlias.ts | 4 +- sdk/nodejs/cluster/getClusterAliases.ts | 4 +- sdk/nodejs/cluster/getNodes.ts | 4 +- sdk/nodejs/ct/container.ts | 4 +- sdk/nodejs/dns.ts | 4 +- sdk/nodejs/getDNS.ts | 4 +- sdk/nodejs/getHosts.ts | 4 +- sdk/nodejs/getTime.ts | 4 +- sdk/nodejs/getVersion.ts | 4 +- sdk/nodejs/hosts.ts | 4 +- sdk/nodejs/package.json | 3 +- sdk/nodejs/permission/getGroup.ts | 4 +- sdk/nodejs/permission/getGroups.ts | 4 +- sdk/nodejs/permission/getPool.ts | 4 +- sdk/nodejs/permission/getPools.ts | 4 +- sdk/nodejs/permission/getRole.ts | 4 +- sdk/nodejs/permission/getRoles.ts | 4 +- sdk/nodejs/permission/getUser.ts | 4 +- sdk/nodejs/permission/getUsers.ts | 4 +- sdk/nodejs/permission/group.ts | 4 +- sdk/nodejs/permission/pool.ts | 4 +- sdk/nodejs/permission/role.ts | 4 +- sdk/nodejs/permission/user.ts | 4 +- sdk/nodejs/provider.ts | 4 +- sdk/nodejs/storage/file.ts | 4 +- sdk/nodejs/storage/getDatastores.ts | 4 +- sdk/nodejs/time.ts | 4 +- sdk/nodejs/utilities.ts | 5 + sdk/nodejs/vm/virtualMachine.ts | 4 +- sdk/python/pulumi_proxmoxve/_utilities.py | 3 + sdk/python/pulumi_proxmoxve/certifi.py | 2 + .../pulumi_proxmoxve/cluster/cluster_alias.py | 2 + .../cluster/cluster_ip_set.py | 2 + .../cluster/get_cluster_alias.py | 2 + .../cluster/get_cluster_aliases.py | 2 + .../pulumi_proxmoxve/cluster/get_nodes.py | 2 + sdk/python/pulumi_proxmoxve/ct/container.py | 2 + sdk/python/pulumi_proxmoxve/dns.py | 2 + sdk/python/pulumi_proxmoxve/get_dns.py | 2 + sdk/python/pulumi_proxmoxve/get_hosts.py | 2 + sdk/python/pulumi_proxmoxve/get_time.py | 2 + sdk/python/pulumi_proxmoxve/get_version.py | 2 + sdk/python/pulumi_proxmoxve/hosts.py | 2 + .../pulumi_proxmoxve/permission/get_group.py | 2 + .../pulumi_proxmoxve/permission/get_groups.py | 2 + .../pulumi_proxmoxve/permission/get_pool.py | 2 + .../pulumi_proxmoxve/permission/get_pools.py | 2 + .../pulumi_proxmoxve/permission/get_role.py | 2 + .../pulumi_proxmoxve/permission/get_roles.py | 2 + .../pulumi_proxmoxve/permission/get_user.py | 2 + .../pulumi_proxmoxve/permission/get_users.py | 2 + .../pulumi_proxmoxve/permission/group.py | 2 + .../pulumi_proxmoxve/permission/pool.py | 2 + .../pulumi_proxmoxve/permission/role.py | 2 + .../pulumi_proxmoxve/permission/user.py | 2 + sdk/python/pulumi_proxmoxve/provider.py | 2 + .../pulumi_proxmoxve/pulumi-plugin.json | 5 + sdk/python/pulumi_proxmoxve/storage/file.py | 2 + .../storage/get_datastores.py | 2 + sdk/python/pulumi_proxmoxve/time.py | 2 + .../pulumi_proxmoxve/vm/virtual_machine.py | 2 + sdk/python/setup.py | 3 +- 109 files changed, 685 insertions(+), 108 deletions(-) create mode 100644 sdk/dotnet/pulumi-plugin.json create mode 100644 sdk/go/proxmoxve/cluster/pulumiUtilities.go create mode 100644 sdk/go/proxmoxve/ct/pulumiUtilities.go create mode 100644 sdk/go/proxmoxve/permission/pulumiUtilities.go create mode 100644 sdk/go/proxmoxve/pulumi-plugin.json create mode 100644 sdk/go/proxmoxve/storage/pulumiUtilities.go create mode 100644 sdk/go/proxmoxve/vm/pulumiUtilities.go create mode 100644 sdk/python/pulumi_proxmoxve/pulumi-plugin.json diff --git a/provider/cmd/pulumi-resource-proxmoxve/schema.json b/provider/cmd/pulumi-resource-proxmoxve/schema.json index 76362281..29a2a3fd 100644 --- a/provider/cmd/pulumi-resource-proxmoxve/schema.json +++ b/provider/cmd/pulumi-resource-proxmoxve/schema.json @@ -10,6 +10,7 @@ "license": "Apache-2.0", "attribution": "This Pulumi package is based on the [`proxmoxve` Terraform Provider](https://github.com/bpg/terraform-provider-proxmoxve).", "repository": "https://github.com/muhlba91/pulumi-proxmoxve", + "pluginDownloadURL": "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}", "meta": { "moduleFormat": "(.*)(?:/[^/]*)" }, @@ -3952,6 +3953,7 @@ } }, "go": { + "generateExtraInputTypes": true, "generateResourceContainerTypes": true, "importBasePath": "github.com/muhlba91/pulumi-proxmoxve/sdk/go/proxmoxve" }, diff --git a/provider/go.mod b/provider/go.mod index c92e6ef1..e1e61cb5 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -9,6 +9,6 @@ replace ( require ( github.com/bpg/terraform-provider-proxmox v0.5.0 - github.com/pulumi/pulumi-terraform-bridge/v3 v3.13.0 - github.com/pulumi/pulumi/sdk/v3 v3.19.0 + github.com/pulumi/pulumi-terraform-bridge/v3 v3.16.0 + github.com/pulumi/pulumi/sdk/v3 v3.22.1 ) diff --git a/provider/go.sum b/provider/go.sum index 05c7a96e..6cf317a7 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -296,8 +296,6 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.7.1 h1:DP+LD/t0njgoPBvT5MJLeliUIVQR03hiKR6vezdwHlc= -github.com/gofrs/flock v0.7.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -384,6 +382,7 @@ github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -423,8 +422,9 @@ github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9 github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.16.1 h1:IVQwpTGNRRIHafnTs2dQLIk4ENtneRIEEJWOVDqz99o= +github.com/hashicorp/go-hclog v0.16.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.1.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-kms-wrapping/entropy v0.1.0/go.mod h1:d1g9WGtAunDNpek8jUIEJnBlbgKS1N2Q61QkHiZyR1g= @@ -496,7 +496,6 @@ github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlz github.com/hashicorp/terraform-plugin-test/v2 v2.2.1 h1:d3Rzmi5bnRzcAZon91FY4TDCMUYdU8c5vpPpf2Tz+c8= github.com/hashicorp/terraform-plugin-test/v2 v2.2.1/go.mod h1:eZ9JL3O69Cb71Skn6OhHyj17sLmHRb+H6VrDcJjKrYU= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/terraform-svchost v0.0.0-20191119180714-d2e4933b9136/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/vault/api v1.0.5-0.20200519221902-385fac77e20f/go.mod h1:euTFbi2YJgwcju3imEt919lhJKF68nN1cQPq3aA+kBE= @@ -680,6 +679,7 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -715,12 +715,13 @@ github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7z github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.13.0 h1:KVw2dm/6EVJCGfjiLizg3CDiHZPz73l5qTCOsHk9xjY= -github.com/pulumi/pulumi-terraform-bridge/v3 v3.13.0/go.mod h1:VlFvdieJz0VtsZuzGeRMfEFVZJzLZIwB4+HNHosXrOA= -github.com/pulumi/pulumi/pkg/v3 v3.19.0 h1:4n4M0sk25Iaij6qdzTKE5WCw7Jt6ykbQj089xrs5AxY= -github.com/pulumi/pulumi/pkg/v3 v3.19.0/go.mod h1:EYJ0EUzwpGGavDRlb8gDtK64JMz1XuFAmlCIcHWW0w0= -github.com/pulumi/pulumi/sdk/v3 v3.19.0 h1:nNJQQtXEK8rj/iM4mergHRneVl7GSHe0hK/2MvV7kbo= -github.com/pulumi/pulumi/sdk/v3 v3.19.0/go.mod h1:AnbQmAhp0ezO/MhcVjqkhvoQnxZ0+79Xb035NcuKrtM= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.16.0 h1:od8gjlVjl90J4Pkm/9s00t8Qp+zFr7JT1ur/P2QrGGk= +github.com/pulumi/pulumi-terraform-bridge/v3 v3.16.0/go.mod h1:6XmD2LSnYLnzS4jiEvnEYFnBsyEe52wc3Rs37NTpMxM= +github.com/pulumi/pulumi/pkg/v3 v3.22.0 h1:WdxiTbXsm+puD9D514VVo2dSJWG6MnHi9ep3NgXo4PA= +github.com/pulumi/pulumi/pkg/v3 v3.22.0/go.mod h1:qvt0qEDtNTtJxy6IVGNfx8x/xEFeiPtDdfGNhfFh3jk= +github.com/pulumi/pulumi/sdk/v3 v3.22.0/go.mod h1:WHOQB00iuHZyXhwrymxpKXhpOahSguJIpRjVokmM11w= +github.com/pulumi/pulumi/sdk/v3 v3.22.1 h1:xmoxh08lhgQKgFkp8HcQ4NdFuetA5WgvwmY2yBW5wpM= +github.com/pulumi/pulumi/sdk/v3 v3.22.1/go.mod h1:WHOQB00iuHZyXhwrymxpKXhpOahSguJIpRjVokmM11w= github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e h1:Dik4Qe/+xguB8JagPyXNlbOnRiXGmq/PSPQTGunYnTk= github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ= github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20210629210550-59d24255d71f h1:YWtQ7xeRQvB9h5Uwtrl9wDKRKkyLTXWBzU7x0c9VOZ4= @@ -731,8 +732,9 @@ github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg= +github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -842,8 +844,9 @@ github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.3.1/go.mod h1:YO23e2L18AG+ZYQfSobnY4G65nvwvprPCxBHkufUH1k= github.com/zclconf/go-cty v1.8.2/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= -github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.9.1 h1:viqrgQwFl5UpSxc046qblj78wZXVDFnSOufaOTER+cc= +github.com/zclconf/go-cty v1.9.1/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= @@ -894,8 +897,9 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf h1:B2n+Zi5QeYRDAEodEu72OS36gmTWjgpXr2+cWcBW90o= golang.org/x/crypto v0.0.0-20210506145944-38f3c27a63bf/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= 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= @@ -1081,6 +1085,7 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 h1:c8PlLMqBbOHoqtjteWm5/kbe6rNY2pbRfbIMVnepueo= diff --git a/provider/resources.go b/provider/resources.go index 2c62ae90..d68935c7 100644 --- a/provider/resources.go +++ b/provider/resources.go @@ -61,6 +61,7 @@ func Provider() tfbridge.ProviderInfo { Homepage: "https://github.com/muhlba91/pulumi-proxmoxve", Repository: "https://github.com/muhlba91/pulumi-proxmoxve", GitHubOrg: "bpg", + PluginDownloadURL: "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}", Config: map[string]*tfbridge.SchemaInfo{}, PreConfigureCallback: preConfigureCallback, Resources: map[string]*tfbridge.ResourceInfo{ diff --git a/sdk/dotnet/Pulumi.ProxmoxVE.csproj b/sdk/dotnet/Pulumi.ProxmoxVE.csproj index d5332022..a24f7194 100644 --- a/sdk/dotnet/Pulumi.ProxmoxVE.csproj +++ b/sdk/dotnet/Pulumi.ProxmoxVE.csproj @@ -39,6 +39,11 @@ + + + + + diff --git a/sdk/dotnet/pulumi-plugin.json b/sdk/dotnet/pulumi-plugin.json new file mode 100644 index 00000000..9cb8a7eb --- /dev/null +++ b/sdk/dotnet/pulumi-plugin.json @@ -0,0 +1,5 @@ +{ + "resource": true, + "name": "proxmoxve", + "server": "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}" +} diff --git a/sdk/dotnet/version.txt b/sdk/dotnet/version.txt index 212c61a1..8fef6241 100644 --- a/sdk/dotnet/version.txt +++ b/sdk/dotnet/version.txt @@ -1 +1 @@ -0.0.1-alpha.1637516154+bcc93c62.dirty +0.0.1-alpha.1639643795+7e695cee.dirty diff --git a/sdk/go/proxmoxve/certifi.go b/sdk/go/proxmoxve/certifi.go index 671d2819..13cf0659 100644 --- a/sdk/go/proxmoxve/certifi.go +++ b/sdk/go/proxmoxve/certifi.go @@ -60,6 +60,7 @@ func NewCertifi(ctx *pulumi.Context, if args.PrivateKey == nil { return nil, errors.New("invalid value for required argument 'PrivateKey'") } + opts = pkgResourceDefaultOpts(opts) var resource Certifi err := ctx.RegisterResource("proxmoxve:index/certifi:Certifi", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/cluster/clusterAlias.go b/sdk/go/proxmoxve/cluster/clusterAlias.go index e0d45bf6..7cd082e5 100644 --- a/sdk/go/proxmoxve/cluster/clusterAlias.go +++ b/sdk/go/proxmoxve/cluster/clusterAlias.go @@ -32,6 +32,7 @@ func NewClusterAlias(ctx *pulumi.Context, if args.Cidr == nil { return nil, errors.New("invalid value for required argument 'Cidr'") } + opts = pkgResourceDefaultOpts(opts) var resource ClusterAlias err := ctx.RegisterResource("proxmoxve:Cluster/clusterAlias:ClusterAlias", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/cluster/clusterIPSet.go b/sdk/go/proxmoxve/cluster/clusterIPSet.go index 424ac4d1..a92faed8 100644 --- a/sdk/go/proxmoxve/cluster/clusterIPSet.go +++ b/sdk/go/proxmoxve/cluster/clusterIPSet.go @@ -28,6 +28,7 @@ func NewClusterIPSet(ctx *pulumi.Context, args = &ClusterIPSetArgs{} } + opts = pkgResourceDefaultOpts(opts) var resource ClusterIPSet err := ctx.RegisterResource("proxmoxve:Cluster/clusterIPSet:ClusterIPSet", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/cluster/getClusterAlias.go b/sdk/go/proxmoxve/cluster/getClusterAlias.go index f74f429d..8a00564b 100644 --- a/sdk/go/proxmoxve/cluster/getClusterAlias.go +++ b/sdk/go/proxmoxve/cluster/getClusterAlias.go @@ -11,6 +11,7 @@ import ( ) func LookupClusterAlias(ctx *pulumi.Context, args *LookupClusterAliasArgs, opts ...pulumi.InvokeOption) (*LookupClusterAliasResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupClusterAliasResult err := ctx.Invoke("proxmoxve:Cluster/getClusterAlias:getClusterAlias", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/cluster/getClusterAliases.go b/sdk/go/proxmoxve/cluster/getClusterAliases.go index e6657dd1..4d3ddbee 100644 --- a/sdk/go/proxmoxve/cluster/getClusterAliases.go +++ b/sdk/go/proxmoxve/cluster/getClusterAliases.go @@ -8,6 +8,7 @@ import ( ) func GetClusterAliases(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetClusterAliasesResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetClusterAliasesResult err := ctx.Invoke("proxmoxve:Cluster/getClusterAliases:getClusterAliases", nil, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/cluster/getNodes.go b/sdk/go/proxmoxve/cluster/getNodes.go index ea76aaae..4c997fbb 100644 --- a/sdk/go/proxmoxve/cluster/getNodes.go +++ b/sdk/go/proxmoxve/cluster/getNodes.go @@ -8,6 +8,7 @@ import ( ) func GetNodes(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetNodesResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetNodesResult err := ctx.Invoke("proxmoxve:Cluster/getNodes:getNodes", nil, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/cluster/pulumiUtilities.go b/sdk/go/proxmoxve/cluster/pulumiUtilities.go new file mode 100644 index 00000000..3a6ebbec --- /dev/null +++ b/sdk/go/proxmoxve/cluster/pulumiUtilities.go @@ -0,0 +1,99 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package cluster + +import ( + "fmt" + "os" + "reflect" + "regexp" + "strconv" + "strings" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type envParser func(v string) interface{} + +func parseEnvBool(v string) interface{} { + b, err := strconv.ParseBool(v) + if err != nil { + return nil + } + return b +} + +func parseEnvInt(v string) interface{} { + i, err := strconv.ParseInt(v, 0, 0) + if err != nil { + return nil + } + return int(i) +} + +func parseEnvFloat(v string) interface{} { + f, err := strconv.ParseFloat(v, 64) + if err != nil { + return nil + } + return f +} + +func parseEnvStringArray(v string) interface{} { + var result pulumi.StringArray + for _, item := range strings.Split(v, ";") { + result = append(result, pulumi.String(item)) + } + return result +} + +func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { + for _, v := range vars { + if value := os.Getenv(v); value != "" { + if parser != nil { + return parser(value) + } + return value + } + } + return def +} + +// PkgVersion uses reflection to determine the version of the current package. +func PkgVersion() (semver.Version, error) { + type sentinal struct{} + pkgPath := reflect.TypeOf(sentinal{}).PkgPath() + re := regexp.MustCompile("^.*/pulumi-proxmoxve/sdk(/v\\d+)?") + if match := re.FindStringSubmatch(pkgPath); match != nil { + vStr := match[1] + if len(vStr) == 0 { // If the version capture group was empty, default to v1. + return semver.Version{Major: 1}, nil + } + return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil + } + return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath) +} + +// isZero is a null safe check for if a value is it's types zero value. +func isZero(v interface{}) bool { + if v == nil { + return true + } + return reflect.ValueOf(v).IsZero() +} + +// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} + +// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} diff --git a/sdk/go/proxmoxve/ct/container.go b/sdk/go/proxmoxve/ct/container.go index 5c388f02..5187f416 100644 --- a/sdk/go/proxmoxve/ct/container.go +++ b/sdk/go/proxmoxve/ct/container.go @@ -54,6 +54,7 @@ func NewContainer(ctx *pulumi.Context, if args.NodeName == nil { return nil, errors.New("invalid value for required argument 'NodeName'") } + opts = pkgResourceDefaultOpts(opts) var resource Container err := ctx.RegisterResource("proxmoxve:CT/container:Container", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/ct/pulumiUtilities.go b/sdk/go/proxmoxve/ct/pulumiUtilities.go new file mode 100644 index 00000000..4ab5fe15 --- /dev/null +++ b/sdk/go/proxmoxve/ct/pulumiUtilities.go @@ -0,0 +1,99 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package ct + +import ( + "fmt" + "os" + "reflect" + "regexp" + "strconv" + "strings" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type envParser func(v string) interface{} + +func parseEnvBool(v string) interface{} { + b, err := strconv.ParseBool(v) + if err != nil { + return nil + } + return b +} + +func parseEnvInt(v string) interface{} { + i, err := strconv.ParseInt(v, 0, 0) + if err != nil { + return nil + } + return int(i) +} + +func parseEnvFloat(v string) interface{} { + f, err := strconv.ParseFloat(v, 64) + if err != nil { + return nil + } + return f +} + +func parseEnvStringArray(v string) interface{} { + var result pulumi.StringArray + for _, item := range strings.Split(v, ";") { + result = append(result, pulumi.String(item)) + } + return result +} + +func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { + for _, v := range vars { + if value := os.Getenv(v); value != "" { + if parser != nil { + return parser(value) + } + return value + } + } + return def +} + +// PkgVersion uses reflection to determine the version of the current package. +func PkgVersion() (semver.Version, error) { + type sentinal struct{} + pkgPath := reflect.TypeOf(sentinal{}).PkgPath() + re := regexp.MustCompile("^.*/pulumi-proxmoxve/sdk(/v\\d+)?") + if match := re.FindStringSubmatch(pkgPath); match != nil { + vStr := match[1] + if len(vStr) == 0 { // If the version capture group was empty, default to v1. + return semver.Version{Major: 1}, nil + } + return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil + } + return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath) +} + +// isZero is a null safe check for if a value is it's types zero value. +func isZero(v interface{}) bool { + if v == nil { + return true + } + return reflect.ValueOf(v).IsZero() +} + +// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} + +// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} diff --git a/sdk/go/proxmoxve/dns.go b/sdk/go/proxmoxve/dns.go index 9bdf6073..643d9e0a 100644 --- a/sdk/go/proxmoxve/dns.go +++ b/sdk/go/proxmoxve/dns.go @@ -35,6 +35,7 @@ func NewDNS(ctx *pulumi.Context, if args.NodeName == nil { return nil, errors.New("invalid value for required argument 'NodeName'") } + opts = pkgResourceDefaultOpts(opts) var resource DNS err := ctx.RegisterResource("proxmoxve:index/dNS:DNS", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/getDNS.go b/sdk/go/proxmoxve/getDNS.go index b3009ccb..77b9519e 100644 --- a/sdk/go/proxmoxve/getDNS.go +++ b/sdk/go/proxmoxve/getDNS.go @@ -11,6 +11,7 @@ import ( ) func LookupDNS(ctx *pulumi.Context, args *LookupDNSArgs, opts ...pulumi.InvokeOption) (*LookupDNSResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupDNSResult err := ctx.Invoke("proxmoxve:index/getDNS:getDNS", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/getHosts.go b/sdk/go/proxmoxve/getHosts.go index 470dd7a3..b22ff2eb 100644 --- a/sdk/go/proxmoxve/getHosts.go +++ b/sdk/go/proxmoxve/getHosts.go @@ -11,6 +11,7 @@ import ( ) func LookupHosts(ctx *pulumi.Context, args *LookupHostsArgs, opts ...pulumi.InvokeOption) (*LookupHostsResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupHostsResult err := ctx.Invoke("proxmoxve:index/getHosts:getHosts", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/getTime.go b/sdk/go/proxmoxve/getTime.go index 081d049b..0a85fd4c 100644 --- a/sdk/go/proxmoxve/getTime.go +++ b/sdk/go/proxmoxve/getTime.go @@ -11,6 +11,7 @@ import ( ) func LookupTime(ctx *pulumi.Context, args *LookupTimeArgs, opts ...pulumi.InvokeOption) (*LookupTimeResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupTimeResult err := ctx.Invoke("proxmoxve:index/getTime:getTime", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/getVersion.go b/sdk/go/proxmoxve/getVersion.go index cecb2bdc..31ec7289 100644 --- a/sdk/go/proxmoxve/getVersion.go +++ b/sdk/go/proxmoxve/getVersion.go @@ -8,6 +8,7 @@ import ( ) func GetVersion(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetVersionResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetVersionResult err := ctx.Invoke("proxmoxve:index/getVersion:getVersion", nil, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/hosts.go b/sdk/go/proxmoxve/hosts.go index 017402cb..276142fc 100644 --- a/sdk/go/proxmoxve/hosts.go +++ b/sdk/go/proxmoxve/hosts.go @@ -39,6 +39,7 @@ func NewHosts(ctx *pulumi.Context, if args.NodeName == nil { return nil, errors.New("invalid value for required argument 'NodeName'") } + opts = pkgResourceDefaultOpts(opts) var resource Hosts err := ctx.RegisterResource("proxmoxve:index/hosts:Hosts", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getGroup.go b/sdk/go/proxmoxve/permission/getGroup.go index 68e8482a..8f84a373 100644 --- a/sdk/go/proxmoxve/permission/getGroup.go +++ b/sdk/go/proxmoxve/permission/getGroup.go @@ -11,6 +11,7 @@ import ( ) func LookupGroup(ctx *pulumi.Context, args *LookupGroupArgs, opts ...pulumi.InvokeOption) (*LookupGroupResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupGroupResult err := ctx.Invoke("proxmoxve:Permission/getGroup:getGroup", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getGroups.go b/sdk/go/proxmoxve/permission/getGroups.go index 58fd2787..fc563ae0 100644 --- a/sdk/go/proxmoxve/permission/getGroups.go +++ b/sdk/go/proxmoxve/permission/getGroups.go @@ -8,6 +8,7 @@ import ( ) func GetGroups(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetGroupsResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetGroupsResult err := ctx.Invoke("proxmoxve:Permission/getGroups:getGroups", nil, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getPool.go b/sdk/go/proxmoxve/permission/getPool.go index b1315139..61b061e7 100644 --- a/sdk/go/proxmoxve/permission/getPool.go +++ b/sdk/go/proxmoxve/permission/getPool.go @@ -11,6 +11,7 @@ import ( ) func LookupPool(ctx *pulumi.Context, args *LookupPoolArgs, opts ...pulumi.InvokeOption) (*LookupPoolResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupPoolResult err := ctx.Invoke("proxmoxve:Permission/getPool:getPool", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getPools.go b/sdk/go/proxmoxve/permission/getPools.go index 738aa1e8..f4ac7e22 100644 --- a/sdk/go/proxmoxve/permission/getPools.go +++ b/sdk/go/proxmoxve/permission/getPools.go @@ -8,6 +8,7 @@ import ( ) func GetPools(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetPoolsResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetPoolsResult err := ctx.Invoke("proxmoxve:Permission/getPools:getPools", nil, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getRole.go b/sdk/go/proxmoxve/permission/getRole.go index e0715535..cc202155 100644 --- a/sdk/go/proxmoxve/permission/getRole.go +++ b/sdk/go/proxmoxve/permission/getRole.go @@ -11,6 +11,7 @@ import ( ) func LookupRole(ctx *pulumi.Context, args *LookupRoleArgs, opts ...pulumi.InvokeOption) (*LookupRoleResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupRoleResult err := ctx.Invoke("proxmoxve:Permission/getRole:getRole", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getRoles.go b/sdk/go/proxmoxve/permission/getRoles.go index 9f81e61e..07a677e0 100644 --- a/sdk/go/proxmoxve/permission/getRoles.go +++ b/sdk/go/proxmoxve/permission/getRoles.go @@ -8,6 +8,7 @@ import ( ) func GetRoles(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetRolesResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetRolesResult err := ctx.Invoke("proxmoxve:Permission/getRoles:getRoles", nil, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getUser.go b/sdk/go/proxmoxve/permission/getUser.go index 244200d7..b95eb9ac 100644 --- a/sdk/go/proxmoxve/permission/getUser.go +++ b/sdk/go/proxmoxve/permission/getUser.go @@ -11,6 +11,7 @@ import ( ) func LookupUser(ctx *pulumi.Context, args *LookupUserArgs, opts ...pulumi.InvokeOption) (*LookupUserResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv LookupUserResult err := ctx.Invoke("proxmoxve:Permission/getUser:getUser", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/getUsers.go b/sdk/go/proxmoxve/permission/getUsers.go index fc343497..a0c0eaac 100644 --- a/sdk/go/proxmoxve/permission/getUsers.go +++ b/sdk/go/proxmoxve/permission/getUsers.go @@ -8,6 +8,7 @@ import ( ) func GetUsers(ctx *pulumi.Context, opts ...pulumi.InvokeOption) (*GetUsersResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetUsersResult err := ctx.Invoke("proxmoxve:Permission/getUsers:getUsers", nil, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/group.go b/sdk/go/proxmoxve/permission/group.go index 84dd4ae4..3b4f25f7 100644 --- a/sdk/go/proxmoxve/permission/group.go +++ b/sdk/go/proxmoxve/permission/group.go @@ -34,6 +34,7 @@ func NewGroup(ctx *pulumi.Context, if args.GroupId == nil { return nil, errors.New("invalid value for required argument 'GroupId'") } + opts = pkgResourceDefaultOpts(opts) var resource Group err := ctx.RegisterResource("proxmoxve:Permission/group:Group", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/pool.go b/sdk/go/proxmoxve/permission/pool.go index f87601f1..efa344b6 100644 --- a/sdk/go/proxmoxve/permission/pool.go +++ b/sdk/go/proxmoxve/permission/pool.go @@ -32,6 +32,7 @@ func NewPool(ctx *pulumi.Context, if args.PoolId == nil { return nil, errors.New("invalid value for required argument 'PoolId'") } + opts = pkgResourceDefaultOpts(opts) var resource Pool err := ctx.RegisterResource("proxmoxve:Permission/pool:Pool", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/pulumiUtilities.go b/sdk/go/proxmoxve/permission/pulumiUtilities.go new file mode 100644 index 00000000..4c451bff --- /dev/null +++ b/sdk/go/proxmoxve/permission/pulumiUtilities.go @@ -0,0 +1,99 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package permission + +import ( + "fmt" + "os" + "reflect" + "regexp" + "strconv" + "strings" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type envParser func(v string) interface{} + +func parseEnvBool(v string) interface{} { + b, err := strconv.ParseBool(v) + if err != nil { + return nil + } + return b +} + +func parseEnvInt(v string) interface{} { + i, err := strconv.ParseInt(v, 0, 0) + if err != nil { + return nil + } + return int(i) +} + +func parseEnvFloat(v string) interface{} { + f, err := strconv.ParseFloat(v, 64) + if err != nil { + return nil + } + return f +} + +func parseEnvStringArray(v string) interface{} { + var result pulumi.StringArray + for _, item := range strings.Split(v, ";") { + result = append(result, pulumi.String(item)) + } + return result +} + +func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { + for _, v := range vars { + if value := os.Getenv(v); value != "" { + if parser != nil { + return parser(value) + } + return value + } + } + return def +} + +// PkgVersion uses reflection to determine the version of the current package. +func PkgVersion() (semver.Version, error) { + type sentinal struct{} + pkgPath := reflect.TypeOf(sentinal{}).PkgPath() + re := regexp.MustCompile("^.*/pulumi-proxmoxve/sdk(/v\\d+)?") + if match := re.FindStringSubmatch(pkgPath); match != nil { + vStr := match[1] + if len(vStr) == 0 { // If the version capture group was empty, default to v1. + return semver.Version{Major: 1}, nil + } + return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil + } + return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath) +} + +// isZero is a null safe check for if a value is it's types zero value. +func isZero(v interface{}) bool { + if v == nil { + return true + } + return reflect.ValueOf(v).IsZero() +} + +// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} + +// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} diff --git a/sdk/go/proxmoxve/permission/role.go b/sdk/go/proxmoxve/permission/role.go index 29ee5ab4..3c41cc10 100644 --- a/sdk/go/proxmoxve/permission/role.go +++ b/sdk/go/proxmoxve/permission/role.go @@ -33,6 +33,7 @@ func NewRole(ctx *pulumi.Context, if args.RoleId == nil { return nil, errors.New("invalid value for required argument 'RoleId'") } + opts = pkgResourceDefaultOpts(opts) var resource Role err := ctx.RegisterResource("proxmoxve:Permission/role:Role", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/permission/user.go b/sdk/go/proxmoxve/permission/user.go index d8a33e26..500fade3 100644 --- a/sdk/go/proxmoxve/permission/user.go +++ b/sdk/go/proxmoxve/permission/user.go @@ -51,6 +51,7 @@ func NewUser(ctx *pulumi.Context, if args.UserId == nil { return nil, errors.New("invalid value for required argument 'UserId'") } + opts = pkgResourceDefaultOpts(opts) var resource User err := ctx.RegisterResource("proxmoxve:Permission/user:User", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/provider.go b/sdk/go/proxmoxve/provider.go index 3f783042..41bf359f 100644 --- a/sdk/go/proxmoxve/provider.go +++ b/sdk/go/proxmoxve/provider.go @@ -25,6 +25,7 @@ func NewProvider(ctx *pulumi.Context, args = &ProviderArgs{} } + opts = pkgResourceDefaultOpts(opts) var resource Provider err := ctx.RegisterResource("pulumi:providers:proxmoxve", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/pulumi-plugin.json b/sdk/go/proxmoxve/pulumi-plugin.json new file mode 100644 index 00000000..9cb8a7eb --- /dev/null +++ b/sdk/go/proxmoxve/pulumi-plugin.json @@ -0,0 +1,5 @@ +{ + "resource": true, + "name": "proxmoxve", + "server": "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}" +} diff --git a/sdk/go/proxmoxve/pulumiUtilities.go b/sdk/go/proxmoxve/pulumiUtilities.go index 865a0caf..0c4b3219 100644 --- a/sdk/go/proxmoxve/pulumiUtilities.go +++ b/sdk/go/proxmoxve/pulumiUtilities.go @@ -83,3 +83,17 @@ func isZero(v interface{}) bool { } return reflect.ValueOf(v).IsZero() } + +// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} + +// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} diff --git a/sdk/go/proxmoxve/storage/file.go b/sdk/go/proxmoxve/storage/file.go index 59ef7ede..264d7956 100644 --- a/sdk/go/proxmoxve/storage/file.go +++ b/sdk/go/proxmoxve/storage/file.go @@ -47,6 +47,7 @@ func NewFile(ctx *pulumi.Context, if args.NodeName == nil { return nil, errors.New("invalid value for required argument 'NodeName'") } + opts = pkgResourceDefaultOpts(opts) var resource File err := ctx.RegisterResource("proxmoxve:Storage/file:File", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/storage/getDatastores.go b/sdk/go/proxmoxve/storage/getDatastores.go index d1e68f85..c2b465ca 100644 --- a/sdk/go/proxmoxve/storage/getDatastores.go +++ b/sdk/go/proxmoxve/storage/getDatastores.go @@ -11,6 +11,7 @@ import ( ) func GetDatastores(ctx *pulumi.Context, args *GetDatastoresArgs, opts ...pulumi.InvokeOption) (*GetDatastoresResult, error) { + opts = pkgInvokeDefaultOpts(opts) var rv GetDatastoresResult err := ctx.Invoke("proxmoxve:Storage/getDatastores:getDatastores", args, &rv, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/storage/pulumiUtilities.go b/sdk/go/proxmoxve/storage/pulumiUtilities.go new file mode 100644 index 00000000..513bf253 --- /dev/null +++ b/sdk/go/proxmoxve/storage/pulumiUtilities.go @@ -0,0 +1,99 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package storage + +import ( + "fmt" + "os" + "reflect" + "regexp" + "strconv" + "strings" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type envParser func(v string) interface{} + +func parseEnvBool(v string) interface{} { + b, err := strconv.ParseBool(v) + if err != nil { + return nil + } + return b +} + +func parseEnvInt(v string) interface{} { + i, err := strconv.ParseInt(v, 0, 0) + if err != nil { + return nil + } + return int(i) +} + +func parseEnvFloat(v string) interface{} { + f, err := strconv.ParseFloat(v, 64) + if err != nil { + return nil + } + return f +} + +func parseEnvStringArray(v string) interface{} { + var result pulumi.StringArray + for _, item := range strings.Split(v, ";") { + result = append(result, pulumi.String(item)) + } + return result +} + +func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { + for _, v := range vars { + if value := os.Getenv(v); value != "" { + if parser != nil { + return parser(value) + } + return value + } + } + return def +} + +// PkgVersion uses reflection to determine the version of the current package. +func PkgVersion() (semver.Version, error) { + type sentinal struct{} + pkgPath := reflect.TypeOf(sentinal{}).PkgPath() + re := regexp.MustCompile("^.*/pulumi-proxmoxve/sdk(/v\\d+)?") + if match := re.FindStringSubmatch(pkgPath); match != nil { + vStr := match[1] + if len(vStr) == 0 { // If the version capture group was empty, default to v1. + return semver.Version{Major: 1}, nil + } + return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil + } + return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath) +} + +// isZero is a null safe check for if a value is it's types zero value. +func isZero(v interface{}) bool { + if v == nil { + return true + } + return reflect.ValueOf(v).IsZero() +} + +// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} + +// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} diff --git a/sdk/go/proxmoxve/time.go b/sdk/go/proxmoxve/time.go index 1181e036..9f5d7ac8 100644 --- a/sdk/go/proxmoxve/time.go +++ b/sdk/go/proxmoxve/time.go @@ -37,6 +37,7 @@ func NewTime(ctx *pulumi.Context, if args.TimeZone == nil { return nil, errors.New("invalid value for required argument 'TimeZone'") } + opts = pkgResourceDefaultOpts(opts) var resource Time err := ctx.RegisterResource("proxmoxve:index/time:Time", name, args, &resource, opts...) if err != nil { diff --git a/sdk/go/proxmoxve/vm/pulumiUtilities.go b/sdk/go/proxmoxve/vm/pulumiUtilities.go new file mode 100644 index 00000000..8ab147a6 --- /dev/null +++ b/sdk/go/proxmoxve/vm/pulumiUtilities.go @@ -0,0 +1,99 @@ +// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +package vm + +import ( + "fmt" + "os" + "reflect" + "regexp" + "strconv" + "strings" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" +) + +type envParser func(v string) interface{} + +func parseEnvBool(v string) interface{} { + b, err := strconv.ParseBool(v) + if err != nil { + return nil + } + return b +} + +func parseEnvInt(v string) interface{} { + i, err := strconv.ParseInt(v, 0, 0) + if err != nil { + return nil + } + return int(i) +} + +func parseEnvFloat(v string) interface{} { + f, err := strconv.ParseFloat(v, 64) + if err != nil { + return nil + } + return f +} + +func parseEnvStringArray(v string) interface{} { + var result pulumi.StringArray + for _, item := range strings.Split(v, ";") { + result = append(result, pulumi.String(item)) + } + return result +} + +func getEnvOrDefault(def interface{}, parser envParser, vars ...string) interface{} { + for _, v := range vars { + if value := os.Getenv(v); value != "" { + if parser != nil { + return parser(value) + } + return value + } + } + return def +} + +// PkgVersion uses reflection to determine the version of the current package. +func PkgVersion() (semver.Version, error) { + type sentinal struct{} + pkgPath := reflect.TypeOf(sentinal{}).PkgPath() + re := regexp.MustCompile("^.*/pulumi-proxmoxve/sdk(/v\\d+)?") + if match := re.FindStringSubmatch(pkgPath); match != nil { + vStr := match[1] + if len(vStr) == 0 { // If the version capture group was empty, default to v1. + return semver.Version{Major: 1}, nil + } + return semver.MustParse(fmt.Sprintf("%s.0.0", vStr[2:])), nil + } + return semver.Version{}, fmt.Errorf("failed to determine the package version from %s", pkgPath) +} + +// isZero is a null safe check for if a value is it's types zero value. +func isZero(v interface{}) bool { + if v == nil { + return true + } + return reflect.ValueOf(v).IsZero() +} + +// pkgResourceDefaultOpts provides package level defaults to pulumi.OptionResource. +func pkgResourceDefaultOpts(opts []pulumi.ResourceOption) []pulumi.ResourceOption { + defaults := []pulumi.ResourceOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} + +// pkgInvokeDefaultOpts provides package level defaults to pulumi.OptionInvoke. +func pkgInvokeDefaultOpts(opts []pulumi.InvokeOption) []pulumi.InvokeOption { + defaults := []pulumi.InvokeOption{pulumi.PluginDownloadURL("https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}")} + + return append(defaults, opts...) +} diff --git a/sdk/go/proxmoxve/vm/virtualMachine.go b/sdk/go/proxmoxve/vm/virtualMachine.go index c938f67d..e64200d9 100644 --- a/sdk/go/proxmoxve/vm/virtualMachine.go +++ b/sdk/go/proxmoxve/vm/virtualMachine.go @@ -96,6 +96,7 @@ func NewVirtualMachine(ctx *pulumi.Context, if args.NodeName == nil { return nil, errors.New("invalid value for required argument 'NodeName'") } + opts = pkgResourceDefaultOpts(opts) var resource VirtualMachine err := ctx.RegisterResource("proxmoxve:VM/virtualMachine:VirtualMachine", name, args, &resource, opts...) if err != nil { diff --git a/sdk/nodejs/certifi.ts b/sdk/nodejs/certifi.ts index 4c158683..d69155ef 100644 --- a/sdk/nodejs/certifi.ts +++ b/sdk/nodejs/certifi.ts @@ -142,9 +142,7 @@ export class Certifi extends pulumi.CustomResource { resourceInputs["subject"] = undefined /*out*/; resourceInputs["subjectAlternativeNames"] = undefined /*out*/; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Certifi.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/cluster/clusterAlias.ts b/sdk/nodejs/cluster/clusterAlias.ts index e1e2cf37..c12510f4 100644 --- a/sdk/nodejs/cluster/clusterAlias.ts +++ b/sdk/nodejs/cluster/clusterAlias.ts @@ -70,9 +70,7 @@ export class ClusterAlias extends pulumi.CustomResource { resourceInputs["comment"] = args ? args.comment : undefined; resourceInputs["name"] = args ? args.name : undefined; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ClusterAlias.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/cluster/clusterIPSet.ts b/sdk/nodejs/cluster/clusterIPSet.ts index eb7efe06..00cf6470 100644 --- a/sdk/nodejs/cluster/clusterIPSet.ts +++ b/sdk/nodejs/cluster/clusterIPSet.ts @@ -68,9 +68,7 @@ export class ClusterIPSet extends pulumi.CustomResource { resourceInputs["comment"] = args ? args.comment : undefined; resourceInputs["name"] = args ? args.name : undefined; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ClusterIPSet.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/cluster/getClusterAlias.ts b/sdk/nodejs/cluster/getClusterAlias.ts index 7764fa0c..5c73d8b0 100644 --- a/sdk/nodejs/cluster/getClusterAlias.ts +++ b/sdk/nodejs/cluster/getClusterAlias.ts @@ -9,9 +9,7 @@ export function getClusterAlias(args: GetClusterAliasArgs, opts?: pulumi.InvokeO opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Cluster/getClusterAlias:getClusterAlias", { "name": args.name, }, opts); diff --git a/sdk/nodejs/cluster/getClusterAliases.ts b/sdk/nodejs/cluster/getClusterAliases.ts index 65d9ddd6..4d23a4d4 100644 --- a/sdk/nodejs/cluster/getClusterAliases.ts +++ b/sdk/nodejs/cluster/getClusterAliases.ts @@ -9,9 +9,7 @@ export function getClusterAliases(opts?: pulumi.InvokeOptions): Promise { opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Cluster/getNodes:getNodes", { }, opts); } diff --git a/sdk/nodejs/ct/container.ts b/sdk/nodejs/ct/container.ts index 21a6b465..88b806ba 100644 --- a/sdk/nodejs/ct/container.ts +++ b/sdk/nodejs/ct/container.ts @@ -137,9 +137,7 @@ export class Container extends pulumi.CustomResource { resourceInputs["template"] = args ? args.template : undefined; resourceInputs["vmId"] = args ? args.vmId : undefined; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Container.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/dns.ts b/sdk/nodejs/dns.ts index 89eb267a..34aeab63 100644 --- a/sdk/nodejs/dns.ts +++ b/sdk/nodejs/dns.ts @@ -73,9 +73,7 @@ export class DNS extends pulumi.CustomResource { resourceInputs["nodeName"] = args ? args.nodeName : undefined; resourceInputs["servers"] = args ? args.servers : undefined; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DNS.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/getDNS.ts b/sdk/nodejs/getDNS.ts index 7fffef16..99ab7ce2 100644 --- a/sdk/nodejs/getDNS.ts +++ b/sdk/nodejs/getDNS.ts @@ -9,9 +9,7 @@ export function getDNS(args: GetDNSArgs, opts?: pulumi.InvokeOptions): Promise opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Permission/getGroups:getGroups", { }, opts); } diff --git a/sdk/nodejs/permission/getPool.ts b/sdk/nodejs/permission/getPool.ts index e25bcc4c..0040052a 100644 --- a/sdk/nodejs/permission/getPool.ts +++ b/sdk/nodejs/permission/getPool.ts @@ -10,9 +10,7 @@ export function getPool(args: GetPoolArgs, opts?: pulumi.InvokeOptions): Promise opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Permission/getPool:getPool", { "poolId": args.poolId, }, opts); diff --git a/sdk/nodejs/permission/getPools.ts b/sdk/nodejs/permission/getPools.ts index e696d12d..4247e697 100644 --- a/sdk/nodejs/permission/getPools.ts +++ b/sdk/nodejs/permission/getPools.ts @@ -9,9 +9,7 @@ export function getPools(opts?: pulumi.InvokeOptions): Promise { opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Permission/getPools:getPools", { }, opts); } diff --git a/sdk/nodejs/permission/getRole.ts b/sdk/nodejs/permission/getRole.ts index 817abc84..da95a81a 100644 --- a/sdk/nodejs/permission/getRole.ts +++ b/sdk/nodejs/permission/getRole.ts @@ -9,9 +9,7 @@ export function getRole(args: GetRoleArgs, opts?: pulumi.InvokeOptions): Promise opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Permission/getRole:getRole", { "roleId": args.roleId, }, opts); diff --git a/sdk/nodejs/permission/getRoles.ts b/sdk/nodejs/permission/getRoles.ts index de465f92..5a101ece 100644 --- a/sdk/nodejs/permission/getRoles.ts +++ b/sdk/nodejs/permission/getRoles.ts @@ -9,9 +9,7 @@ export function getRoles(opts?: pulumi.InvokeOptions): Promise { opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Permission/getRoles:getRoles", { }, opts); } diff --git a/sdk/nodejs/permission/getUser.ts b/sdk/nodejs/permission/getUser.ts index d909d250..72160176 100644 --- a/sdk/nodejs/permission/getUser.ts +++ b/sdk/nodejs/permission/getUser.ts @@ -10,9 +10,7 @@ export function getUser(args: GetUserArgs, opts?: pulumi.InvokeOptions): Promise opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Permission/getUser:getUser", { "userId": args.userId, }, opts); diff --git a/sdk/nodejs/permission/getUsers.ts b/sdk/nodejs/permission/getUsers.ts index 2afdb6b1..5975db1d 100644 --- a/sdk/nodejs/permission/getUsers.ts +++ b/sdk/nodejs/permission/getUsers.ts @@ -9,9 +9,7 @@ export function getUsers(opts?: pulumi.InvokeOptions): Promise { opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Permission/getUsers:getUsers", { }, opts); } diff --git a/sdk/nodejs/permission/group.ts b/sdk/nodejs/permission/group.ts index dcfe83b0..ca50cb68 100644 --- a/sdk/nodejs/permission/group.ts +++ b/sdk/nodejs/permission/group.ts @@ -77,9 +77,7 @@ export class Group extends pulumi.CustomResource { resourceInputs["groupId"] = args ? args.groupId : undefined; resourceInputs["members"] = undefined /*out*/; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Group.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/permission/pool.ts b/sdk/nodejs/permission/pool.ts index dac871ae..7ac5d4c8 100644 --- a/sdk/nodejs/permission/pool.ts +++ b/sdk/nodejs/permission/pool.ts @@ -71,9 +71,7 @@ export class Pool extends pulumi.CustomResource { resourceInputs["poolId"] = args ? args.poolId : undefined; resourceInputs["members"] = undefined /*out*/; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Pool.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/permission/role.ts b/sdk/nodejs/permission/role.ts index d6df02eb..1f202781 100644 --- a/sdk/nodejs/permission/role.ts +++ b/sdk/nodejs/permission/role.ts @@ -67,9 +67,7 @@ export class Role extends pulumi.CustomResource { resourceInputs["privileges"] = args ? args.privileges : undefined; resourceInputs["roleId"] = args ? args.roleId : undefined; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Role.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/permission/user.ts b/sdk/nodejs/permission/user.ts index c0696185..a2893aeb 100644 --- a/sdk/nodejs/permission/user.ts +++ b/sdk/nodejs/permission/user.ts @@ -122,9 +122,7 @@ export class User extends pulumi.CustomResource { resourceInputs["password"] = args ? args.password : undefined; resourceInputs["userId"] = args ? args.userId : undefined; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(User.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/provider.ts b/sdk/nodejs/provider.ts index 6c106bb9..70be49b7 100644 --- a/sdk/nodejs/provider.ts +++ b/sdk/nodejs/provider.ts @@ -40,9 +40,7 @@ export class Provider extends pulumi.ProviderResource { { resourceInputs["virtualEnvironment"] = pulumi.output(args ? args.virtualEnvironment : undefined).apply(JSON.stringify); } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Provider.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/storage/file.ts b/sdk/nodejs/storage/file.ts index 4b2b09ad..65dc652c 100644 --- a/sdk/nodejs/storage/file.ts +++ b/sdk/nodejs/storage/file.ts @@ -110,9 +110,7 @@ export class File extends pulumi.CustomResource { resourceInputs["fileSize"] = undefined /*out*/; resourceInputs["fileTag"] = undefined /*out*/; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(File.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/storage/getDatastores.ts b/sdk/nodejs/storage/getDatastores.ts index a738fff9..1c88f0f2 100644 --- a/sdk/nodejs/storage/getDatastores.ts +++ b/sdk/nodejs/storage/getDatastores.ts @@ -9,9 +9,7 @@ export function getDatastores(args: GetDatastoresArgs, opts?: pulumi.InvokeOptio opts = {} } - if (!opts.version) { - opts.version = utilities.getVersion(); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); return pulumi.runtime.invoke("proxmoxve:Storage/getDatastores:getDatastores", { "nodeName": args.nodeName, }, opts); diff --git a/sdk/nodejs/time.ts b/sdk/nodejs/time.ts index fa49021f..4f169b3a 100644 --- a/sdk/nodejs/time.ts +++ b/sdk/nodejs/time.ts @@ -79,9 +79,7 @@ export class Time extends pulumi.CustomResource { resourceInputs["localTime"] = undefined /*out*/; resourceInputs["utcTime"] = undefined /*out*/; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Time.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/nodejs/utilities.ts b/sdk/nodejs/utilities.ts index a152dc1e..d4c5cdc2 100644 --- a/sdk/nodejs/utilities.ts +++ b/sdk/nodejs/utilities.ts @@ -47,3 +47,8 @@ export function getVersion(): string { } return version; } + +/** @internal */ +export function resourceOptsDefaults(): any { + return { version: getVersion(), pluginDownloadURL: "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}" }; +} diff --git a/sdk/nodejs/vm/virtualMachine.ts b/sdk/nodejs/vm/virtualMachine.ts index adc75b94..d813204b 100644 --- a/sdk/nodejs/vm/virtualMachine.ts +++ b/sdk/nodejs/vm/virtualMachine.ts @@ -263,9 +263,7 @@ export class VirtualMachine extends pulumi.CustomResource { resourceInputs["macAddresses"] = undefined /*out*/; resourceInputs["networkInterfaceNames"] = undefined /*out*/; } - if (!opts.version) { - opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()}); - } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VirtualMachine.__pulumiType, name, resourceInputs, opts); } } diff --git a/sdk/python/pulumi_proxmoxve/_utilities.py b/sdk/python/pulumi_proxmoxve/_utilities.py index cfdc7572..6e182f5e 100644 --- a/sdk/python/pulumi_proxmoxve/_utilities.py +++ b/sdk/python/pulumi_proxmoxve/_utilities.py @@ -234,3 +234,6 @@ def lifted_func(*args, opts=None, **kwargs): **resolved_args['kwargs'])) return (lambda _: lifted_func) + +def get_plugin_download_url(): + return "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}" diff --git a/sdk/python/pulumi_proxmoxve/certifi.py b/sdk/python/pulumi_proxmoxve/certifi.py index a8e99e3c..fafb35a0 100644 --- a/sdk/python/pulumi_proxmoxve/certifi.py +++ b/sdk/python/pulumi_proxmoxve/certifi.py @@ -383,6 +383,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/cluster/cluster_alias.py b/sdk/python/pulumi_proxmoxve/cluster/cluster_alias.py index acc37bb3..b704902c 100644 --- a/sdk/python/pulumi_proxmoxve/cluster/cluster_alias.py +++ b/sdk/python/pulumi_proxmoxve/cluster/cluster_alias.py @@ -171,6 +171,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/cluster/cluster_ip_set.py b/sdk/python/pulumi_proxmoxve/cluster/cluster_ip_set.py index 7e066725..5bffca7f 100644 --- a/sdk/python/pulumi_proxmoxve/cluster/cluster_ip_set.py +++ b/sdk/python/pulumi_proxmoxve/cluster/cluster_ip_set.py @@ -174,6 +174,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/cluster/get_cluster_alias.py b/sdk/python/pulumi_proxmoxve/cluster/get_cluster_alias.py index 4c0208b1..60daea5f 100644 --- a/sdk/python/pulumi_proxmoxve/cluster/get_cluster_alias.py +++ b/sdk/python/pulumi_proxmoxve/cluster/get_cluster_alias.py @@ -81,6 +81,8 @@ def get_cluster_alias(name: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Cluster/getClusterAlias:getClusterAlias', __args__, opts=opts, typ=GetClusterAliasResult).value return AwaitableGetClusterAliasResult( diff --git a/sdk/python/pulumi_proxmoxve/cluster/get_cluster_aliases.py b/sdk/python/pulumi_proxmoxve/cluster/get_cluster_aliases.py index 049df249..daad053f 100644 --- a/sdk/python/pulumi_proxmoxve/cluster/get_cluster_aliases.py +++ b/sdk/python/pulumi_proxmoxve/cluster/get_cluster_aliases.py @@ -60,6 +60,8 @@ def get_cluster_aliases(opts: Optional[pulumi.InvokeOptions] = None) -> Awaitabl opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Cluster/getClusterAliases:getClusterAliases', __args__, opts=opts, typ=GetClusterAliasesResult).value return AwaitableGetClusterAliasesResult( diff --git a/sdk/python/pulumi_proxmoxve/cluster/get_nodes.py b/sdk/python/pulumi_proxmoxve/cluster/get_nodes.py index 3069d42c..51b0f0f0 100644 --- a/sdk/python/pulumi_proxmoxve/cluster/get_nodes.py +++ b/sdk/python/pulumi_proxmoxve/cluster/get_nodes.py @@ -132,6 +132,8 @@ def get_nodes(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetNodesR opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Cluster/getNodes:getNodes', __args__, opts=opts, typ=GetNodesResult).value return AwaitableGetNodesResult( diff --git a/sdk/python/pulumi_proxmoxve/ct/container.py b/sdk/python/pulumi_proxmoxve/ct/container.py index b225e10e..c96f6646 100644 --- a/sdk/python/pulumi_proxmoxve/ct/container.py +++ b/sdk/python/pulumi_proxmoxve/ct/container.py @@ -558,6 +558,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/dns.py b/sdk/python/pulumi_proxmoxve/dns.py index a5268a30..b0d2bcd5 100644 --- a/sdk/python/pulumi_proxmoxve/dns.py +++ b/sdk/python/pulumi_proxmoxve/dns.py @@ -170,6 +170,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/get_dns.py b/sdk/python/pulumi_proxmoxve/get_dns.py index bd23ac18..eb172311 100644 --- a/sdk/python/pulumi_proxmoxve/get_dns.py +++ b/sdk/python/pulumi_proxmoxve/get_dns.py @@ -81,6 +81,8 @@ def get_dns(node_name: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:index/getDNS:getDNS', __args__, opts=opts, typ=GetDNSResult).value return AwaitableGetDNSResult( diff --git a/sdk/python/pulumi_proxmoxve/get_hosts.py b/sdk/python/pulumi_proxmoxve/get_hosts.py index 7e81dde9..95b5622b 100644 --- a/sdk/python/pulumi_proxmoxve/get_hosts.py +++ b/sdk/python/pulumi_proxmoxve/get_hosts.py @@ -100,6 +100,8 @@ def get_hosts(node_name: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:index/getHosts:getHosts', __args__, opts=opts, typ=GetHostsResult).value return AwaitableGetHostsResult( diff --git a/sdk/python/pulumi_proxmoxve/get_time.py b/sdk/python/pulumi_proxmoxve/get_time.py index 17a67d76..e77aabbe 100644 --- a/sdk/python/pulumi_proxmoxve/get_time.py +++ b/sdk/python/pulumi_proxmoxve/get_time.py @@ -90,6 +90,8 @@ def get_time(node_name: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:index/getTime:getTime', __args__, opts=opts, typ=GetTimeResult).value return AwaitableGetTimeResult( diff --git a/sdk/python/pulumi_proxmoxve/get_version.py b/sdk/python/pulumi_proxmoxve/get_version.py index 1ed2a0a8..e84ec232 100644 --- a/sdk/python/pulumi_proxmoxve/get_version.py +++ b/sdk/python/pulumi_proxmoxve/get_version.py @@ -87,6 +87,8 @@ def get_version(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetVers opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:index/getVersion:getVersion', __args__, opts=opts, typ=GetVersionResult).value return AwaitableGetVersionResult( diff --git a/sdk/python/pulumi_proxmoxve/hosts.py b/sdk/python/pulumi_proxmoxve/hosts.py index 3eab8220..74b21a12 100644 --- a/sdk/python/pulumi_proxmoxve/hosts.py +++ b/sdk/python/pulumi_proxmoxve/hosts.py @@ -185,6 +185,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/permission/get_group.py b/sdk/python/pulumi_proxmoxve/permission/get_group.py index 1d6fb72d..f92ecd53 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_group.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_group.py @@ -91,6 +91,8 @@ def get_group(group_id: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getGroup:getGroup', __args__, opts=opts, typ=GetGroupResult).value return AwaitableGetGroupResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/get_groups.py b/sdk/python/pulumi_proxmoxve/permission/get_groups.py index 0f07bdc0..27d81778 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_groups.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_groups.py @@ -69,6 +69,8 @@ def get_groups(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetGroup opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getGroups:getGroups', __args__, opts=opts, typ=GetGroupsResult).value return AwaitableGetGroupsResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/get_pool.py b/sdk/python/pulumi_proxmoxve/permission/get_pool.py index c3de0544..a3d0a9fd 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_pool.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_pool.py @@ -82,6 +82,8 @@ def get_pool(pool_id: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getPool:getPool', __args__, opts=opts, typ=GetPoolResult).value return AwaitableGetPoolResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/get_pools.py b/sdk/python/pulumi_proxmoxve/permission/get_pools.py index 3a105f2a..028e026d 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_pools.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_pools.py @@ -60,6 +60,8 @@ def get_pools(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPoolsR opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getPools:getPools', __args__, opts=opts, typ=GetPoolsResult).value return AwaitableGetPoolsResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/get_role.py b/sdk/python/pulumi_proxmoxve/permission/get_role.py index 10acbeac..72fb11e2 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_role.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_role.py @@ -72,6 +72,8 @@ def get_role(role_id: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getRole:getRole', __args__, opts=opts, typ=GetRoleResult).value return AwaitableGetRoleResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/get_roles.py b/sdk/python/pulumi_proxmoxve/permission/get_roles.py index e7958287..72b5a5c5 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_roles.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_roles.py @@ -78,6 +78,8 @@ def get_roles(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRolesR opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getRoles:getRoles', __args__, opts=opts, typ=GetRolesResult).value return AwaitableGetRolesResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/get_user.py b/sdk/python/pulumi_proxmoxve/permission/get_user.py index 67f61422..2cf19c83 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_user.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_user.py @@ -145,6 +145,8 @@ def get_user(user_id: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getUser:getUser', __args__, opts=opts, typ=GetUserResult).value return AwaitableGetUserResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/get_users.py b/sdk/python/pulumi_proxmoxve/permission/get_users.py index 6fc755dd..8c852066 100644 --- a/sdk/python/pulumi_proxmoxve/permission/get_users.py +++ b/sdk/python/pulumi_proxmoxve/permission/get_users.py @@ -132,6 +132,8 @@ def get_users(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetUsersR opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Permission/getUsers:getUsers', __args__, opts=opts, typ=GetUsersResult).value return AwaitableGetUsersResult( diff --git a/sdk/python/pulumi_proxmoxve/permission/group.py b/sdk/python/pulumi_proxmoxve/permission/group.py index 9b8982c5..d25fe856 100644 --- a/sdk/python/pulumi_proxmoxve/permission/group.py +++ b/sdk/python/pulumi_proxmoxve/permission/group.py @@ -189,6 +189,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/permission/pool.py b/sdk/python/pulumi_proxmoxve/permission/pool.py index d9e863b7..35a5c5be 100644 --- a/sdk/python/pulumi_proxmoxve/permission/pool.py +++ b/sdk/python/pulumi_proxmoxve/permission/pool.py @@ -154,6 +154,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/permission/role.py b/sdk/python/pulumi_proxmoxve/permission/role.py index 14bec308..0f6eddd1 100644 --- a/sdk/python/pulumi_proxmoxve/permission/role.py +++ b/sdk/python/pulumi_proxmoxve/permission/role.py @@ -135,6 +135,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/permission/user.py b/sdk/python/pulumi_proxmoxve/permission/user.py index 7a114c21..850f4c01 100644 --- a/sdk/python/pulumi_proxmoxve/permission/user.py +++ b/sdk/python/pulumi_proxmoxve/permission/user.py @@ -452,6 +452,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/provider.py b/sdk/python/pulumi_proxmoxve/provider.py index a5133ad4..ed7f2c62 100644 --- a/sdk/python/pulumi_proxmoxve/provider.py +++ b/sdk/python/pulumi_proxmoxve/provider.py @@ -82,6 +82,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/pulumi-plugin.json b/sdk/python/pulumi_proxmoxve/pulumi-plugin.json new file mode 100644 index 00000000..9cb8a7eb --- /dev/null +++ b/sdk/python/pulumi_proxmoxve/pulumi-plugin.json @@ -0,0 +1,5 @@ +{ + "resource": true, + "name": "proxmoxve", + "server": "https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}" +} diff --git a/sdk/python/pulumi_proxmoxve/storage/file.py b/sdk/python/pulumi_proxmoxve/storage/file.py index 3fa84d6a..611e8d2b 100644 --- a/sdk/python/pulumi_proxmoxve/storage/file.py +++ b/sdk/python/pulumi_proxmoxve/storage/file.py @@ -306,6 +306,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/storage/get_datastores.py b/sdk/python/pulumi_proxmoxve/storage/get_datastores.py index dfba680b..80151e6b 100644 --- a/sdk/python/pulumi_proxmoxve/storage/get_datastores.py +++ b/sdk/python/pulumi_proxmoxve/storage/get_datastores.py @@ -144,6 +144,8 @@ def get_datastores(node_name: Optional[str] = None, opts = pulumi.InvokeOptions() if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() __ret__ = pulumi.runtime.invoke('proxmoxve:Storage/getDatastores:getDatastores', __args__, opts=opts, typ=GetDatastoresResult).value return AwaitableGetDatastoresResult( diff --git a/sdk/python/pulumi_proxmoxve/time.py b/sdk/python/pulumi_proxmoxve/time.py index bff3a75c..1d12672e 100644 --- a/sdk/python/pulumi_proxmoxve/time.py +++ b/sdk/python/pulumi_proxmoxve/time.py @@ -167,6 +167,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/pulumi_proxmoxve/vm/virtual_machine.py b/sdk/python/pulumi_proxmoxve/vm/virtual_machine.py index 24d68e30..784b97e0 100644 --- a/sdk/python/pulumi_proxmoxve/vm/virtual_machine.py +++ b/sdk/python/pulumi_proxmoxve/vm/virtual_machine.py @@ -1217,6 +1217,8 @@ def _internal_init(__self__, raise TypeError('Expected resource options to be a ResourceOptions instance') if opts.version is None: opts.version = _utilities.get_version() + if opts.plugin_download_url is None: + opts.plugin_download_url = _utilities.get_plugin_download_url() if opts.id is None: if __props__ is not None: raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') diff --git a/sdk/python/setup.py b/sdk/python/setup.py index d0f7633d..1ebc0732 100644 --- a/sdk/python/setup.py +++ b/sdk/python/setup.py @@ -15,7 +15,7 @@ class InstallPluginCommand(install): def run(self): install.run(self) try: - check_call(['pulumi', 'plugin', 'install', 'resource', 'proxmoxve', PLUGIN_VERSION]) + check_call(['pulumi', 'plugin', 'install', 'resource', 'proxmoxve', PLUGIN_VERSION, '--server', 'https://github.com/muhlba91/pulumi-proxmoxve/releases/download/v${VERSION}']) except OSError as error: if error.errno == errno.ENOENT: print(f""" @@ -55,6 +55,7 @@ def readme(): package_data={ 'pulumi_proxmoxve': [ 'py.typed', + 'pulumi-plugin.json', ] }, install_requires=[