Skip to content

Commit

Permalink
chore: add generated SDKs (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangasta authored Jun 14, 2024
1 parent 5e65bb4 commit 89f7f1d
Show file tree
Hide file tree
Showing 541 changed files with 125,594 additions and 137 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @UpCloudLtd/devex
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-upcloud/bridge-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"auto-aliasing": {
"resources": {
"upcloud_firewall_rules": {
"current": "upcloud:index/firewallRules:FirewallRules",
"current": "upcloud:index/serverFirewallRules:ServerFirewallRules",
"fields": {
"firewall_rule": {
"maxItemsOne": false
Expand Down Expand Up @@ -778,7 +778,6 @@
"auto-settings": {},
"mux": {
"resources": {
"upcloud:index/firewallRules:FirewallRules": 0,
"upcloud:index/floatingIpAddress:FloatingIpAddress": 0,
"upcloud:index/gateway:Gateway": 0,
"upcloud:index/gatewayConnection:GatewayConnection": 0,
Expand Down Expand Up @@ -812,6 +811,7 @@
"upcloud:index/objectStorage:ObjectStorage": 0,
"upcloud:index/router:Router": 0,
"upcloud:index/server:Server": 0,
"upcloud:index/serverFirewallRules:ServerFirewallRules": 0,
"upcloud:index/serverGroup:ServerGroup": 0,
"upcloud:index/storage:Storage": 0,
"upcloud:index/tag:Tag": 0
Expand Down
270 changes: 135 additions & 135 deletions provider/cmd/pulumi-resource-upcloud/schema.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ func Provider() tfbridge.ProviderInfo {
"Pulumi": "3.*",
},
},

Resources: map[string]*tfbridge.ResourceInfo{
"upcloud_firewall_rules": {Tok: tfbridge.MakeResource(mainPkg, mainMod, "ServerFirewallRules")},
},
}

// MustComputeTokens maps all resources and datasources from the upstream provider into Pulumi.
Expand Down
97 changes: 97 additions & 0 deletions sdk/dotnet/Config/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// *** 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! ***

using System;
using System.Collections.Immutable;

namespace Pulumi.Upcloud
{
public static class Config
{
[global::System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "IDE1006", Justification =
"Double underscore prefix used to avoid conflicts with variable names.")]
private sealed class __Value<T>
{
private readonly Func<T> _getter;
private T _value = default!;
private bool _set;

public __Value(Func<T> getter)
{
_getter = getter;
}

public T Get() => _set ? _value : _getter();

public void Set(T value)
{
_value = value;
_set = true;
}
}

private static readonly global::Pulumi.Config __config = new global::Pulumi.Config("upcloud");

private static readonly __Value<string?> _password = new __Value<string?>(() => __config.Get("password"));
/// <summary>
/// Password for UpCloud API user. Can also be configured using the `UPCLOUD_PASSWORD` environment variable.
/// </summary>
public static string? Password
{
get => _password.Get();
set => _password.Set(value);
}

private static readonly __Value<int?> _requestTimeoutSec = new __Value<int?>(() => __config.GetInt32("requestTimeoutSec"));
/// <summary>
/// The duration (in seconds) that the provider waits for an HTTP request towards UpCloud API to complete. Defaults to 120
/// seconds
/// </summary>
public static int? RequestTimeoutSec
{
get => _requestTimeoutSec.Get();
set => _requestTimeoutSec.Set(value);
}

private static readonly __Value<int?> _retryMax = new __Value<int?>(() => __config.GetInt32("retryMax"));
/// <summary>
/// Maximum number of retries
/// </summary>
public static int? RetryMax
{
get => _retryMax.Get();
set => _retryMax.Set(value);
}

private static readonly __Value<int?> _retryWaitMaxSec = new __Value<int?>(() => __config.GetInt32("retryWaitMaxSec"));
/// <summary>
/// Maximum time to wait between retries
/// </summary>
public static int? RetryWaitMaxSec
{
get => _retryWaitMaxSec.Get();
set => _retryWaitMaxSec.Set(value);
}

private static readonly __Value<int?> _retryWaitMinSec = new __Value<int?>(() => __config.GetInt32("retryWaitMinSec"));
/// <summary>
/// Minimum time to wait between retries
/// </summary>
public static int? RetryWaitMinSec
{
get => _retryWaitMinSec.Get();
set => _retryWaitMinSec.Set(value);
}

private static readonly __Value<string?> _username = new __Value<string?>(() => __config.Get("username"));
/// <summary>
/// UpCloud username with API access. Can also be configured using the `UPCLOUD_USERNAME` environment variable.
/// </summary>
public static string? Username
{
get => _username.Get();
set => _username.Set(value);
}

}
}
1 change: 1 addition & 0 deletions sdk/dotnet/Config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A Pulumi package for creating and managing UpCloud resources.
214 changes: 214 additions & 0 deletions sdk/dotnet/FloatingIpAddress.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Upcloud
{
/// <summary>
/// This resource represents a UpCloud floating IP address resource.
///
/// ## Example Usage
///
/// ```csharp
/// using System.Collections.Generic;
/// using System.Linq;
/// using Pulumi;
/// using Upcloud = Pulumi.Upcloud;
///
/// return await Deployment.RunAsync(() =&gt;
/// {
/// // Create a detached floating IP address.
/// var myFloatingAddress = new Upcloud.FloatingIpAddress("myFloatingAddress", new()
/// {
/// Zone = "de-fra1",
/// });
///
/// // Floating IP address assigned to a server resource.
/// var example = new Upcloud.Server("example", new()
/// {
/// Hostname = "terraform.example.tld",
/// Zone = "de-fra1",
/// Plan = "1xCPU-1GB",
/// Template = new Upcloud.Inputs.ServerTemplateArgs
/// {
/// Storage = "Ubuntu Server 20.04 LTS (Focal Fossa)",
/// Size = 25,
/// },
/// NetworkInterfaces = new[]
/// {
/// new Upcloud.Inputs.ServerNetworkInterfaceArgs
/// {
/// Type = "public",
/// },
/// },
/// });
///
/// var myNewFloatingAddress = new Upcloud.FloatingIpAddress("myNewFloatingAddress", new()
/// {
/// MacAddress = example.NetworkInterfaces.Apply(networkInterfaces =&gt; networkInterfaces[0].MacAddress),
/// });
///
/// });
/// ```
///
/// ## Import
///
/// ```sh
/// $ pulumi import upcloud:index/floatingIpAddress:FloatingIpAddress my_new_floating_address 94.237.114.205
/// ```
/// </summary>
[UpcloudResourceType("upcloud:index/floatingIpAddress:FloatingIpAddress")]
public partial class FloatingIpAddress : global::Pulumi.CustomResource
{
/// <summary>
/// Network access for the floating IP address. Supported value: `public`
/// </summary>
[Output("access")]
public Output<string?> Access { get; private set; } = null!;

/// <summary>
/// The address family of new IP address
/// </summary>
[Output("family")]
public Output<string?> Family { get; private set; } = null!;

/// <summary>
/// An UpCloud assigned IP Address
/// </summary>
[Output("ipAddress")]
public Output<string> IpAddress { get; private set; } = null!;

/// <summary>
/// MAC address of server interface to assign address to
/// </summary>
[Output("macAddress")]
public Output<string?> MacAddress { get; private set; } = null!;

/// <summary>
/// Zone of address, required when assigning a detached floating IP address, e.g. `de-fra1`. You can list available zones
/// with `upctl zone list`.
/// </summary>
[Output("zone")]
public Output<string> Zone { get; private set; } = null!;


/// <summary>
/// Create a FloatingIpAddress resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public FloatingIpAddress(string name, FloatingIpAddressArgs? args = null, CustomResourceOptions? options = null)
: base("upcloud:index/floatingIpAddress:FloatingIpAddress", name, args ?? new FloatingIpAddressArgs(), MakeResourceOptions(options, ""))
{
}

private FloatingIpAddress(string name, Input<string> id, FloatingIpAddressState? state = null, CustomResourceOptions? options = null)
: base("upcloud:index/floatingIpAddress:FloatingIpAddress", name, state, MakeResourceOptions(options, id))
{
}

private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing FloatingIpAddress resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="state">Any extra arguments used during the lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static FloatingIpAddress Get(string name, Input<string> id, FloatingIpAddressState? state = null, CustomResourceOptions? options = null)
{
return new FloatingIpAddress(name, id, state, options);
}
}

public sealed class FloatingIpAddressArgs : global::Pulumi.ResourceArgs
{
/// <summary>
/// Network access for the floating IP address. Supported value: `public`
/// </summary>
[Input("access")]
public Input<string>? Access { get; set; }

/// <summary>
/// The address family of new IP address
/// </summary>
[Input("family")]
public Input<string>? Family { get; set; }

/// <summary>
/// MAC address of server interface to assign address to
/// </summary>
[Input("macAddress")]
public Input<string>? MacAddress { get; set; }

/// <summary>
/// Zone of address, required when assigning a detached floating IP address, e.g. `de-fra1`. You can list available zones
/// with `upctl zone list`.
/// </summary>
[Input("zone")]
public Input<string>? Zone { get; set; }

public FloatingIpAddressArgs()
{
}
public static new FloatingIpAddressArgs Empty => new FloatingIpAddressArgs();
}

public sealed class FloatingIpAddressState : global::Pulumi.ResourceArgs
{
/// <summary>
/// Network access for the floating IP address. Supported value: `public`
/// </summary>
[Input("access")]
public Input<string>? Access { get; set; }

/// <summary>
/// The address family of new IP address
/// </summary>
[Input("family")]
public Input<string>? Family { get; set; }

/// <summary>
/// An UpCloud assigned IP Address
/// </summary>
[Input("ipAddress")]
public Input<string>? IpAddress { get; set; }

/// <summary>
/// MAC address of server interface to assign address to
/// </summary>
[Input("macAddress")]
public Input<string>? MacAddress { get; set; }

/// <summary>
/// Zone of address, required when assigning a detached floating IP address, e.g. `de-fra1`. You can list available zones
/// with `upctl zone list`.
/// </summary>
[Input("zone")]
public Input<string>? Zone { get; set; }

public FloatingIpAddressState()
{
}
public static new FloatingIpAddressState Empty => new FloatingIpAddressState();
}
}
Loading

0 comments on commit 89f7f1d

Please sign in to comment.