Skip to content

Commit

Permalink
Fix namespaces, add Java
Browse files Browse the repository at this point in the history
  • Loading branch information
clrxbl committed Apr 16, 2024
1 parent 6d729e0 commit 3d3af08
Show file tree
Hide file tree
Showing 790 changed files with 36,867 additions and 630 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ TF_NAME := ${PACK}
PROVIDER_PATH := provider
VERSION_PATH := ${PROVIDER_PATH}/pkg/version.Version

JAVA_GEN := pulumi-java-gen
JAVA_GEN_VERSION := v0.10.0
TFGEN := pulumi-tfgen-${PACK}
PROVIDER := pulumi-resource-${PACK}
VERSION := $(shell pulumictl get version)
Expand Down Expand Up @@ -41,7 +43,7 @@ prepare::
find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[a]bc/${ORG}/g' {} \; &> /dev/null; \
fi

.PHONY: development provider build_sdks build_nodejs build_dotnet build_go build_python cleanup
.PHONY: development provider build_sdks build_nodejs build_dotnet build_go build_python build_java cleanup

development:: install_plugins provider lint_provider build_sdks install_sdks cleanup # Build the provider & SDKs for a development environment

Expand All @@ -57,7 +59,7 @@ tfgen:: install_plugins
provider:: tfgen install_plugins # build the provider binary
(cd provider && go build -o $(WORKING_DIR)/bin/${PROVIDER} -ldflags "-X ${PROJECT}/${VERSION_PATH}=${VERSION}" ${PROJECT}/${PROVIDER_PATH}/cmd/${PROVIDER})

build_sdks:: install_plugins provider build_nodejs build_python build_go build_dotnet # build all the sdks
build_sdks:: install_plugins provider build_nodejs build_python build_go build_dotnet build_java # build all the sdks

build_nodejs:: VERSION := $(shell pulumictl get version --language javascript)
build_nodejs:: install_plugins tfgen # build the node sdk
Expand Down Expand Up @@ -90,6 +92,16 @@ build_dotnet:: install_plugins tfgen # build the dotnet sdk
build_go:: install_plugins tfgen # build the go sdk
$(WORKING_DIR)/bin/$(TFGEN) go --overlays provider/overlays/go --out sdk/go/

build_java:: PACKAGE_VERSION := $(shell pulumictl get version --language generic)
build_java:: $(WORKING_DIR)/bin/$(JAVA_GEN)
$(WORKING_DIR)/bin/$(JAVA_GEN) generate --schema provider/cmd/$(PROVIDER)/schema.json --out sdk/java --build gradle-nexus
cd sdk/java/ && \
echo "module fake_java_module // Exclude this directory from Go tools\n\ngo 1.17" > go.mod && \
gradle --console=plain build

$(WORKING_DIR)/bin/$(JAVA_GEN)::
$(shell pulumictl download-binary -n pulumi-language-java -v $(JAVA_GEN_VERSION) -r pulumi/pulumi-java)

lint_provider:: provider # lint the provider code
cd provider && golangci-lint run -c ../.golangci.yml

Expand Down
26 changes: 17 additions & 9 deletions provider/cmd/pulumi-resource-pnap/schema.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ func Provider() tfbridge.ProviderInfo {
// "aws_ami": {Tok: tfbridge.MakeDataSource(mainPkg, mainMod, "getAmi")},
},
JavaScript: &tfbridge.JavaScriptInfo{
PackageName: "@phoenixnap/pulumi-pnap",

// List any npm dependencies and their versions
Dependencies: map[string]string{
"@pulumi/pulumi": "^3.0.0",
Expand Down Expand Up @@ -161,10 +163,15 @@ func Provider() tfbridge.ProviderInfo {
GenerateResourceContainerTypes: true,
},
CSharp: &tfbridge.CSharpInfo{
RootNamespace: "PhoenixNAP.Pulumi",

PackageReferences: map[string]string{
"Pulumi": "3.*",
},
},
Java: &tfbridge.JavaInfo{
BasePackage: "com.phoenixnap.pulumi",
},
}

// These are new API's that you may opt to use to automatically compute resource
Expand Down
2 changes: 1 addition & 1 deletion sdk/dotnet/Config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Collections.Immutable;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class Config
{
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion sdk/dotnet/GetEvents.cs → sdk/dotnet/Pnap/GetEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetEvents
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/GetInvoices.cs → sdk/dotnet/Pnap/GetInvoices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetInvoices
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/GetIpBlock.cs → sdk/dotnet/Pnap/GetIpBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetIpBlock
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetLocations
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetPrivateNetwork
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetProductAvailability
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/GetProducts.cs → sdk/dotnet/Pnap/GetProducts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetProducts
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetPublicNetwork
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/GetQuota.cs → sdk/dotnet/Pnap/GetQuota.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetQuota
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetRancherCluster
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetReservation
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/GetServer.cs → sdk/dotnet/Pnap/GetServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetServer
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/GetSshKey.cs → sdk/dotnet/Pnap/GetSshKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetSshKey
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetStorageNetwork
{
Expand Down
3 changes: 2 additions & 1 deletion sdk/dotnet/GetTag.cs → sdk/dotnet/Pnap/GetTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap
namespace PhoenixNAP.Pulumi.Pnap
{
public static class GetTag
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class GetEventsEventArgs : global::Pulumi.InvokeArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class GetEventsEventInputArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class GetEventsEventUserInfoArgs : global::Pulumi.InvokeArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class GetEventsEventUserInfoInputArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class IpBlockTagArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class IpBlockTagGetArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class IpBlockTagTagAssignmentArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class IpBlockTagTagAssignmentGetArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class PrivateNetworkMembershipArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class PrivateNetworkMembershipGetArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class PrivateNetworkServerArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class PrivateNetworkServerGetArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class PublicNetworkIpBlockArgs : global::Pulumi.ResourceArgs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumi.Pnap.Inputs
namespace PhoenixNAP.Pulumi.Pnap.Inputs
{

public sealed class PublicNetworkIpBlockGetArgs : global::Pulumi.ResourceArgs
Expand Down
Loading

0 comments on commit 3d3af08

Please sign in to comment.